If you want to learn programming then I think you should steer clear of the C family of languages as a first language. Once you've got the basic ideas burnt into your brain then I'd guess you can introduce those languages since a lot of embedded stuff is done in it, although with developments like MicroPython (see Micro Python - Python for microcontrollers) then I'm not sure that it will be as relevant in the future.
I voted for Python as a first language (it has a simple syntax with fewer oddities than a lot of other languages, has fantastic libraries, and there's very little verbiage with it), but just having done some largish programming projects (non-embedded) I really appreciate a strongly typed language with a good IDE, e.g., VB.NET in Visual Studio, although this isn't terribly viable for EE work.
As an aside look at http://www.nhtsa.gov/staticfiles/nvs/pdf/NASA_FR_Appendix_A_Software.pdf for details of the investigation that NASA did into the Unexplained Acceleration problems suffered by Toyota cars in the States. The software was all written in C, and the company has a mandatory programming style that forbids the use of certain parts of the language since they are the ones that tend to cause problems.
As CAR Hoare said "There are two ways of constructing a software design. One way is to make it so simple that there are obviously no deficiencies. And the other way is to make it so complicated that there are no obvious deficiencies.". I think he was referring to C++.
I particularly like the inventor of C++ on the entire topic: "There are only two kinds of programming languages: those people always *** about and those nobody uses.”
It's a tricky question and actually not seriously answerable. "What programming language should EE's (sic) learn first" (for those who don't recognise it (sic) means that I am quoting the OP's incorrect use of apostophe ).
The problem is that you don't know if you are dealing with an EE when you teach someone their first programming language.
So there are several answers:
a first programming langauge (learnt at school by everyone ?):
I'd vote for BASIC - easy to get into, easy to get a result, possible to do great things, easy to grow out of and learn seomething else for real work.
a programming langauge taught at Uni to new intake of EEs:
Today, Python - you can use it to do maths, control servers, manage data bases etc. later on I'd look at C, assembler etc but only for EEs with a software bias.
(BTW, despite being a long term MATLAB user I would BAN it from Uni - that's a bit strong I know but I'm becoming increasingly unhappy with the way Mathworks tries to lure students in with a give away priced student version and special Academic deals but charges outrageous prices when you want to use it at work. The basic MATLAB langauge can't make a TCP connection without an £800 add on. Try Pyzo instead. (Phew... rant over))
I voted for Python as the closest I could get to my answer to my guess at the intent of the question.
Personally, I think C and C++ are terrible first programming languages. C is a great language for writing compact code that maps directly into machine language, but for teaching programming concepts IMO you're much better off with a less compact language that clarifies the concepts you're trying to teach.
I voted for Pascal. It was designed from the beginning to teach good programming practices like block structuring, declaring variables before using them, and procedure/function calls. Implementations include bounds checking on arrays so you're less likely to stomp on the wrong memory location, something easy to do in C and hard for a newbie to debug. Implementations also tend to have better compiler error messages than C.
After Pascal, I think an assembly language should come next. C is IMO better learned after assembly language, since in many ways C is a portable assembly language that uses high-level notations. IMO you're going to be a better C programmer if you're familiar with ASM, and you'll be in better shape to debug run-time errors that can only be understood at the ASM level.
Alert readers will notice that I didn't say when to add C++.
I haven't studied Python enough to form an opinion.
Top Comments