As a "first language", Python will be easy to learn and will teach the fundamentals (control flow, conditionals, arrays, libraries, simple things that span literally all of programming).
After that, learning most languages is as simple as learning the syntax and quirks of the given language. That said, anything you need written can be written in C/C++. It is low-level enough that it easily compiles to virtually any assembly language, but is high-level enough to not take thirty minutes to write a single, simple function. As far as other types of languages (MATLAB, R, Pascal), those are rarely required, and should be learned if needed. The vast majority of EEs are not going to ever need MATLAB. C/C++ and Python cover pretty much everything you need. Python is even slowly replacing R as the go-to language for data analysis: Python Displacing R As The Programming Language For Data Science – ReadWrite.
Embedded engineers are not the only ones who use C/C++. Everyone from optical engineers to medical engineers can use them, and the knowledge of the language from one discipline transfers nigh directly from field to field.
What you say is probably true within procedural languages. There is a more fundamental difference in mind set between functional/logic languages (SML, Prolog, F#, OCAML, LISP and so on) and procedural languages (FORTRAN, C, C++, Java, BASIC etc). The first language I learned was FORTRAN (on a main frame with punched cards!), I didn't come to functional languages (SML and PROLOG) until much more recently and it was not easy making the transition.
What you said earlier about fundamental principles is the important thing, that and how to apply them and create basic algorithms and their concepts are things that people new to programming need. Really the particular first language learned isn't the important thing, as long as it is a language that you can learn that underlying knowledge from. Once you have that knowledge you can pretty much pick up any language relatively easily, quite often just being a case of applying a different syntax to the problem you are trying to solve.
It is a bit difficult to select a particular language as it depends on the application.
My day job is research in computer science and I normally program in either ML (a functional programming language) or in C. ML is a much more robust and secure language but you're further removed from low-level operations such as bit shifting, and it is for this reason that I think C is the best language for electronic engineers. Assembler has the drawback that it is too hardware specific. Higher level languages don't give you such direct access to registers and memory.
Though C is low level, you can code in a modular/object orientated way. For example by keeping modules in separate files (which then become equivalent to C++ classes) you can hide local functions and data by declaring it static and only have interface functions visible externally. Of course you don't get inheritance and polymorphism except by having some naming code for functions with different types of arguments but the point I'm trying to make is robustness/maintainability of code is really down to how ordered the writing of it is not on the language used.
I remember someone back in the late 70s early 80s who told me that they programmed a system for scheduling (road) petrol tanker deliveries in it. I was very impressed and bought a book about it only to decide that life was far too short for anything that daft!
Most, not all, of these answers, in my opinion, assume EE's are all embedded systems programmers. In fact, only a small portion of them are. There are RF Engineers, Power Engineers, Controls Engineers, etc... The purpose of the first programming language is not necessarily to make everyone an embedded systems programmer. It's to give us an introduction to programming and some skill we can use later on, of which the ability to analyze data is a huge one.
Top Comments