At our site we teach general engineering - students amongst other things can learn AI, Economics, and bridge-building. Which language should they be taught? Though their needs are different from those of Computing students and of more specialist (e.g. Electrical) Engineering students, their programming needs may be extensive. In Teaching Introductory Programming in Tertiary Engineering Education M.G. Rashed points out that "Computers are increasingly used for a variety of purposes in engineering and science including control, data analysis, simulations and design optimization. It is therefore becoming more important for engineering students who are computer science non-major, to have a robust understanding of computing and to learn how to program". It's over 15 years since we last changed the primary language (I've found a document from 1996 which addresses the issue - Teaching Programming in the Engineering Tripos). In that time much has changed in the world of engineering, so a review of our language choice is timely.
|1985||Pascal as a 1st language|
|1996?||Matlab as a 2nd language|
|1997||C++ as a 1st language|
|???||Compulsory computing questions|
in the 1st year exams.
|2008||Vacation C++ exercise|
|2010||1st week Lego Mindstorms (Matlab)|
|2012||C++ course flipped - 25% more labs|
at the expense of lectures
Firstly then, what factors should influence our choice, and how have those influences changed over the years? Here are a few -
- The value of programming in general - When I was taught Latin at school I was told that it was good for me, it trained my mind. Nowadays Mandarin might be taught on the grounds that it's a common language, or Esperanto because it's an easily learnt, well-designed one. Similar differences of opinion apply to computing languages. Programming skills might have intrinsic value or be widely transferable. According to its advocators, Computational Thinking "involves a set of problem-solving skills and techniques that software engineers use to write programs ... However, computational thinking is applicable to nearly any subject. Students who learn computational thinking across the curriculum begin to see a relationship between different subjects as well as between school and life outside of the classroom. Specific computational thinking techniques include: problem decomposition, pattern recognition, pattern generalization to define abstractions or models, algorithm design, and data analysis and visualization".
- The value of programming for engineering - M.G. Rashed thinks that "The primary target in teaching computing is to enable the students to convert engineering problems into pseudo-code. ... The conversion of this pseudo-code into a program written in one programming language is of secondary importance because it is, in principle, an algorithmic procedure and requires less intellectual effort. ... In the teaching practice, the algorithmic problem- solving and implementation tasks are often entangled simply because the students need to test an algorithm they invented by implementing it. Consequently, the choice of the teaching language should be governed by which language provides the best support to the student in performing the implementation part of the problem-solving task by removing any extra stumbling blocks. For this reason the usefulness of the language after graduating or speed of execution will not be the prime factors when making the choice."
- Requirements of other courses - some other courses assume specific aspects of computing competence.
- Students' previous experience -
A long time ago many students arrived with some programming experience thanks
to home micros running BASIC and schools equipped with BBC micros. Then skills fell
away. More recently, with free Linux being available, and raspberry Pi kits on sale, there's been a recovery in
programming skills, but only amongst the computer literate, meaning that the
distribution of our intake's computing skills is more bi-polar than ever.
Though they may program less than earlier generations did, they use computers far more. In particular they rather expect there to be an app for everything - to supply documentation, to provide an interface to hardware (instead of a remote being provided, etc). They may hope that what they produce looks rather like an app.
- Industry relevance - Anecdotal comments from staff suggest that some companies aren't convinced that we are preparing our students for programming. C is more useful for embedded systems than C++. Matlab experience is often requested. One problem is that the needs of industry change, and aren't easy to predict long enough in advance. The invention of the WWW and cheap, small processors has led to the use of GPS and intelligent sensors in civil engineering projects. Google Maps and Google Apps enrich projects as well as aid communication between workers. One student wrote to me that "surely as a professional chartered engineer if you need to do some programming/coding you would hire a professional who would do it in no time at all plus do it correctly" but it would be a shame if the engineer got ripped off because they hired professionals to write trivial or poorly-spec'd software.
- Language features - ease of use, expressiveness - Despite the popularity of languages such as
FORTRAN and C/C++, there has been much debate about the suitability of these languages for education,
especially when introducing programming to novices. These languages have not been designed specifically for
educational purpose, nor do they make for easy use of the WWW or creation of GUIs. Interpreted languages are growing in popularity (the image is from the M.G. Rashed paper).
- Availability of compilers, IDEs, and teaching materials - We've had some trouble providing easily-installed C++ IDEs across platforms. All the teaching materials are on the WWW. Web2 technology has been exploited -
- Documentation for the 1AC++ Mich course is now WWW-based with online PHP-based teaching aids.
- A 2nd year C++ course went a step further, incorporating online marking.
- The Mars Lander project uses CamTools to host documentation and student-staff communication
- Availability of teaching staff - With class sizes of 90 or so, computing practicals require several skilled helpers.
- Learning styles - Teaching remains based on practicals with demonstrator support. There are fewer lectures. Independent study has been encouraged by providing the MDP disc, giving help to students installing compilers on their own machines, and changing teaching material so that documentation is on the WWW, the exercises requiring the minimum of extra libraries.
- Matlab/Octave - Students use this in week 1. Only in year 2 are they more formally taught it. Matlab has a large range of material produced by univs for ugrads, much of it with a math/engg bias. In a Mathworks newsletter, staff at Vanderbilt University write that "engineers from five major companies ... credited MATLAB with helping them become more efficient and achieve time reductions 'from a week to 15 minutes' and 'from several months to weeks'" citing an automotive engineer’s statement that "MATLAB was a de facto industry standard". Many engineering-related routines and program are available.
- Python - According to Charles Dierbach ("Journal of Computing Sciences in Colleges" 29, 6 (June 2014)), "The Python programming language has been quickly gaining popularity over the past few years as a language of choice for CS1 courses. Some estimates put the rise in use at forty-percent a year". "The Python programming language has been around since its development by Guido van Rossum around 1991. One of the main features of the language is code readability (sometimes described as "executable pseudocode"). Python is an interactive programming language, using dynamic typing. It is also a hybrid language, supporting the imperative, object-oriented and functional programming paradigms. Although used as a scripting language, it is also used for the development of full-scale programs." The University offer courses in Python for number-crunching, etc. Many engineering-related packages are available.
- C++/Objective-C/C# - Students use C++ for about 20 hours in year 1 and at least another 8 hours in year 2. In a Cambridge university C++ course it says "Unless you are already a programmer, you are very strongly advised to learn Python first ... learning another programming language would also do. “Programmer” does not mean in Visual Basic, Excel or even most uses of Matlab; it means in Python, Fortran, C, Pascal etc. It surprises most people, but learning simpler languages first often saves time overall. ... You can learn to use any of these (even Fortran) to a comparable level in about 20% of the time that you will need to learn C++"
- Java - one piece of 3rd year coursework currently requires students to write Java. Their C++ experience is presumed to be a sufficient prerequisite.
Are there advantages in principle in exposing students to several languages? Ultimately it's unavoidable, though perhaps initially it confuses people. We don't compare/contrast languages. We tend to leave that to the students.