Author Topic: what is the most relevant programming language for ee?  (Read 15815 times)

0 Members and 1 Guest are viewing this topic.

Offline hatokayTopic starter

  • Newbie
  • Posts: 8
  • Country: il
what is the most relevant programming language for ee?
« on: November 04, 2018, 12:03:58 am »
hello guys.
iam currently studying electronic engineering and entering my second year.
as of right now they only thought us a little bit of C language. my question is, what programming language is best for ee. i heard pyton and c++ are what i need to know, but what do you guys think.
 

Offline rstofer

  • Super Contributor
  • ***
  • Posts: 9963
  • Country: us
Re: what is the most relevant programming language for ee?
« Reply #1 on: November 04, 2018, 12:08:18 am »
One language war coming up!

I am going to talk about EMBEDDED programming, not some application that tries to cure world hunger!

From my point of view, embedded programming is done in C.  Personally, I don't want objects created and destroyed along with the requisite memory allocation and deallocation on a device with limited resources - so, C++ is out (in my view).  There is a tiny Python for embedded programming but, in general, Python is an interpreted language so of very little use in an embedded application.

Possibly Ada but I just haven't gotten involved with that.  The .gov likes it, the rest of the world, not so much.

Now, looking at the broader 'engineering' world, Fortran is my choice for numeric programming.  I have been using it for nearly 50 years so, yes, I kind of like it.  OTOH, MATLAB is my favorite solver and wxMaxima is right there as well.  Octave is supposed to be useful but I haven't used it.  These selections are for the working engineer who wants to solve something.

I LIKE Pascal but it's been superseded by Modula 2 and Oberon, neither of which I have used.  I play with Pascal from time to time.  I like using it for recursive descent compilers (like the original P4 compiler by N. Wirth).

If you want to change from EE to CS, I suppose C++ and Java are at the top of the heap (particularly Java) and Python is coming along.  Definitely, learn C++ and Java unless you are going to work strictly in the embedded world.
« Last Edit: November 04, 2018, 01:47:17 am by rstofer »
 
The following users thanked this post: Wimberleytech

Offline Crazy_Pete

  • Regular Contributor
  • *
  • Posts: 51
  • Country: us
Re: what is the most relevant programming language for ee?
« Reply #2 on: November 04, 2018, 12:17:05 am »
Well everyone is biased but i would say C++.   It is standard on some platforms anyway (For example much of the Arduino Libs are in C++ and the Arduino IDE links it in for you if needed.)

Generally C and C++ are the most commonly used although i am seeing some python here and there.    If you are new to programming i would learn C++ first.  It is very hard to make the jump from C to C++ since the 2 languages are so close, C++ programmers who started in C tend to "think in C" and lose some of the benefits of C++.

A little known fact is that C++ was originally invented to do large network simulations and is ideally suited for engineering work.  In any case i find it also helpful to learn the assembly language for the MCU in question, if for no other reason than to see what the C++ compiler is actually doing!


Thanks

Crazy Pete
« Last Edit: November 04, 2018, 12:22:11 am by Crazy_Pete »
Your enemies pray for a shovel but your own tongue will dig your grave... (Traveller Proverb)
 

Offline langwadt

  • Super Contributor
  • ***
  • Posts: 4857
  • Country: dk
Re: what is the most relevant programming language for ee?
« Reply #3 on: November 04, 2018, 12:27:05 am »
One language war coming up!

I am going to talk about EMBEDDED programming, not some application that tries to cure world hunger!

From my point of view, embedded programming is done in C.  Personally, I don't want objects created and destroyed along with the requisite memory allocation and deallocation on a device with limited resources - so, C++ is out (in my view).  There is a tiny Python for embedded programming but, in general, Python is an interpreted language so of very little use in an embedded application.

Possibly Ada but I just haven't gotten involved with that.  The .gov likes it, the rest of the world, not so much.

Now, looking at the broader 'engineering' world, Fortran is my choice for numeric programming.  I have been using it for nearly 50 years so, yes, I kind of like it.  OTOH, MATLAB is my favorite solver and wxMaxima is right there as well.  Octave is supposed to be useful but I haven't used it.  These selections for the working engineer that wants to solve something.

I LIKE Pascal but it's been superseded by Modula 2 and Oberon, neither of which I have used.  I play with Pascal from time to time.  I like using it for recursive descent compilers (like the original P4 compiler by N. Wirth).

If you want to change from EE to CS, I suppose C++ and Java are at the top of the heap (particularly Java) and Python is coming along.  Definitely, learn C++ and Java unless you are going to work strictly in the embedded world.

just because C++ has lots of bells and whistles doesn't mean you have to use them, Arduino is basically C++ using only  the stuff that makes sense in a (small) embedded world

I haven't use much python but I'd think it can do what you would else do in Matlab etc. or if you need to do a simple gui or test system for some embedded do-that

 

Offline coppice

  • Super Contributor
  • ***
  • Posts: 10031
  • Country: gb
Re: what is the most relevant programming language for ee?
« Reply #4 on: November 04, 2018, 12:31:12 am »
Somewhere in the broad EE domain pretty much every computer language has relevance. Which particular area are you interested in? Embedded programming? Modelling? I think you need to be more specific to get meaningful answers.
 

Offline Crazy_Pete

  • Regular Contributor
  • *
  • Posts: 51
  • Country: us
Re: what is the most relevant programming language for ee?
« Reply #5 on: November 04, 2018, 12:54:21 am »
>just because C++ has lots of bells and whistles doesn't mean you have to use them, >

A very very important point.   The nice thing about C++ is you can use it as a high level language, a low level language or anything in between and if the compiler and linker are working properly, and you don't use C++ features you don't need, the resulting C++ program should be about identical in memory footprint to a similar C program.

C++ is a very vertically scalable language and can be used for everything from Low Level embedded programming to highly complex abstract models (like the network models it was originally created to simulate.)    The fact that C++ was originally intended to be a modeling language really makes it attractive for scientists and engineers.

Thanks

Crazy Pete
Your enemies pray for a shovel but your own tongue will dig your grave... (Traveller Proverb)
 

Offline T3sl4co1l

  • Super Contributor
  • ***
  • Posts: 22436
  • Country: us
  • Expert, Analog Electronics, PCB Layout, EMC
    • Seven Transistor Labs
Re: what is the most relevant programming language for ee?
« Reply #6 on: November 04, 2018, 01:11:36 am »
Excel. :palm:

Sad, perhaps, but very true. :-DD

If you're doing a lot of data analysis, consider MATLAB (or the free Octave or such), or the many libraries in Python, say.

Analog circuitry, SPICE.

Digital (hard), VHDL or Verilog.  Digital (soft), C and whatever else.  (I don't recommend actually writing much of anything in assembler, but knowing a few instruction sets is, well, instructional to making sure the compiler is writing what you want it to write.  Higher level languages may be tricky to interface in an embedded context, but by that point, you're probably running an OS that can do e.g. JS, Python, etc. native, so who cares.)

Some generic, easy to use languages are good for general purpose use: interfacing with network, OS or device services, creating calculators or tools, running quick calculations without the restrictions of a spreadsheet or the heavy weight of MATLAB, or with higher performance.  JS (ubiquitous, runs in a browser!), Java, Python, C#, VB, etc. come to mind.

Tim
Seven Transistor Labs, LLC
Electronic design, from concept to prototype.
Bringing a project to life?  Send me a message!
 

Offline JustMeHere

  • Frequent Contributor
  • **
  • Posts: 826
  • Country: us
Re: what is the most relevant programming language for ee?
« Reply #7 on: November 04, 2018, 01:12:14 am »
I'm finding that OO encapsulation is very important if you are using libraries.  Stops any issue with variable names.  Don't even have to think about it.

For small stuff, C works better. 

For me
 

Offline Crazy_Pete

  • Regular Contributor
  • *
  • Posts: 51
  • Country: us
Re: what is the most relevant programming language for ee?
« Reply #8 on: November 04, 2018, 02:00:40 am »
As a language war looms  ;) i am compelled to quote Bjarne Stroustrups (creator of C++) answer to the question:  "Which programming language do YOU think is best?"

Without actually thinking about it, he responded "Oh the one programmer feels most comfortable using."

Thanks to All
Crazy Pete
Your enemies pray for a shovel but your own tongue will dig your grave... (Traveller Proverb)
 
The following users thanked this post: Howardlong, newbrain

Offline vk6zgo

  • Super Contributor
  • ***
  • Posts: 7854
  • Country: au
Re: what is the most relevant programming language for ee?
« Reply #9 on: November 04, 2018, 02:05:46 am »
Solder? ;D
 
The following users thanked this post: Berni, BradC, helius, newbrain, capt bullshot

Offline xrunner

  • Super Contributor
  • ***
  • Posts: 7836
  • Country: us
  • hp>Agilent>Keysight>???
Re: what is the most relevant programming language for ee?
« Reply #10 on: November 04, 2018, 02:15:51 am »
For small stuff, C works better. 

For me

Kernighan & Ritchie C, straight from The Good Book (which I still have), that's what I used for years for the small projects I needed to get going in the lab at work.

Times have changed, but it's still a great language.  8)
I told my friends I could teach them to be funny, but they all just laughed at me.
 

Offline spec

  • Frequent Contributor
  • **
  • Posts: 833
  • Country: england
  • MALE
Re: what is the most relevant programming language for ee?
« Reply #11 on: November 04, 2018, 03:45:07 am »
C++  :)
 

Offline CatalinaWOW

  • Super Contributor
  • ***
  • Posts: 5569
  • Country: us
Re: what is the most relevant programming language for ee?
« Reply #12 on: November 04, 2018, 05:51:25 am »
Don't worry too much about it.  When I was an undergraduate the argument was whether Algol or Fortran was best for engineers.  Both have mostly become history.  Right now C or C++ and Python are valuable, but you will likely learn several more languages and many, many variants over your career.

Just a partial list of the languages that have been important to me for at least a year or two.

Fortran, Algol, Pascal, Basic, Forth, APL, Ada, C, C++ 

All of these except Algol and Ada ended up with some fairly significant flavor variants depending on the target processors and environment.
 

Offline Mechatrommer

  • Super Contributor
  • ***
  • Posts: 11714
  • Country: my
  • reassessing directives...
Re: what is the most relevant programming language for ee?
« Reply #13 on: November 04, 2018, 07:55:48 am »
as of right now they only thought us a little bit of C language.
probably thats the only lesson you'll get from them.

when i was back in the day, they taught us "the legendary" Fortran in 3rd (or 4th? cant remember) semester ie second year. and then nothing more. my further knowledge on programming later on are 100% self learning because of interest where all my friends still in the same state until today. i got a chance to learnt Pascal/Delphi, C/C++ and Basic. for the longest time i developed my personal use programs in "the venerable" Visual Basic and at the same time keep dreaming that i will have the same easeness at developing GUI but in C/C++ language IDE. i bought a complete book on MFC but i cant cope with it during the day because i think i was too obsessed with "raw metal i want to do it all from scratch" mental programming state, so i never got to understand MFC, in the end i tried to build my own "MFC" guided by Windows++ book by Paul Dilascia, you dont want to know how much time i spent on developing just a small portion of equivalent MFC. now i have Qt thats what i decided to learn next since VB is becoming obsolete now. but its been years i only touched the surface, its quite a challenge i think due to the age and family responsibilities and other tasks at hand, so i'm now really slow at it. otoh i discarded Delphi/Pascal long time ago, i think just for few months after learning it, i still keep few programs that developed with it though, for historic and remembrance reason ;D Fortran? i abandoned it the day i got an A+ mark on the slip in the end of the semester, i was a programming nerd nuts obsessed with many things and wonders what we can do with it (computer programing) i cant sleep if i dont complete a programming task... the nerdness up to a point when few chicks were keeping an eye on me although my not so interesting appearance :-DD

back to topic, if you have to ask what language? as the wise man said, if you can understand many languages, its better. but if you have to learn ONE language, imho its going to be C/C++, if you dont want to risk obsoletion, there is not a slightest hope that C/C++ is going to obsolete anytime soon, not as Fortran that we learnt back in school.

http://moreisdifferent.com/2015/07/16/why-physicsts-still-use-fortran/
Nature: Evolution and the Illusion of Randomness (Stephen L. Talbott): Its now indisputable that... organisms “expertise” contextualizes its genome, and its nonsense to say that these powers are under the control of the genome being contextualized - Barbara McClintock
 

Offline Feynman

  • Regular Contributor
  • *
  • Posts: 200
  • Country: ch
Re: what is the most relevant programming language for ee?
« Reply #14 on: November 04, 2018, 08:28:57 am »
Since "EE" an "Programming" often lead to "Embedded Programming" C is the most relevant language by far followed by C++.

I agree that Python is relevant as well, because it is very handy to simply have a scripting language in your toolbox (automating stuff, etc).
« Last Edit: November 04, 2018, 08:33:45 am by Feynman »
 

Offline exe

  • Supporter
  • ****
  • Posts: 2647
  • Country: nl
  • self-educated hobbyist
Re: what is the most relevant programming language for ee?
« Reply #15 on: November 04, 2018, 08:30:57 am »
I don't want objects created and destroyed along with the requisite memory allocation and deallocation on a device with limited resources - so, C++ is out (in my view).

I use C++ and static memory allocation. So far I'm happy with it.
 

Offline Fred27

  • Supporter
  • ****
  • Posts: 727
  • Country: gb
    • Fred's blog
Re: what is the most relevant programming language for ee?
« Reply #16 on: November 04, 2018, 08:56:08 am »
 

Offline tggzzz

  • Super Contributor
  • ***
  • Posts: 21225
  • Country: gb
  • Numbers, not adjectives
    • Having fun doing more, with less
Re: what is the most relevant programming language for ee?
« Reply #17 on: November 04, 2018, 09:25:09 am »
Don't focus on the language; they change regularly and will continue to change throughout your career.

Do focus on selecting the right tool for your next job:
  • which languages employers will want you to use. There are surveys of that.
  • what tools are available so you can develop your solution faster, especially libraries
  • ways in which problems can be defined
  • ways in which solutions can be expressed. These should be congruent with the problem, so you can see the implementation is a correct solution of the problem
  • understand what each tool doesn't do
  • seamless implementation of specifications in both hardware and software. Sometimes you need to move implementations from one to the other
and don't use a hammer to insert screws!

So, which tools should engineers have in their toolbox?

Provably correct implementation: Ada/SPARK.

Multicore processing: xC, OCCAM.

Hard real-time embedded, i.e. timings guaranteed by the compiler not by testing and hoping: xC.

Simple embedded programming: C.

Finite State Machines: either a specific tool or one of the standard design patterns in whatever language you are using.

Statistics: R and similar.

High performance computing and numerical codes: Fortran.

General purpose, without other overriding constraints: Java or Python.

Analogue electronics: Spice

RF: whichever very expensive tool your employer has purchased, or a limited freeware version.

Digital HDLs, especially for FPGAs: Verilog or VHDL.

Scalable soft-realtime, e.g. telecoms systems: Java.

Quick and dirty number manipulation: a spreadsheet.

Algebra, when exploring conceptual designs: Mathematica.

Be aware that C++ has become so complex that everybody and project has to choose a subset that is used and a subset that is avoided. One problem is that every project/designer/library chooses a different subset, often incompatible and often without realising the consequences.
There are lies, damned lies, statistics - and ADC/DAC specs.
Glider pilot's aphorism: "there is no substitute for span". Retort: "There is a substitute: skill+imagination. But you can buy span".
Having fun doing more, with less
 
The following users thanked this post: basinstreetdesign

Offline brucehoult

  • Super Contributor
  • ***
  • Posts: 4767
  • Country: nz
Re: what is the most relevant programming language for ee?
« Reply #18 on: November 04, 2018, 11:09:41 am »
Don't focus on the language; they change regularly and will continue to change throughout your career.

Not really. I first programmed in C in 1983 and C++ in 1988 and those are still what 95% of my work in operating systems, compilers and interpreters and JITs, runtime libraries, and embedded programming use, 30 to 35 years later.

Most of the other 5% is bash/grep/sort/etc/perl. Perl is 30 years old and Perl 5 24 years. The unix utilities are 35 to 40+ years old.

And I do all my editing in emacs. It's similar vintage.

I'd say you can't go wrong learning those tools. They're going to be here forever, even if there is something else that comes into popularity from time to time.
 

Offline tggzzz

  • Super Contributor
  • ***
  • Posts: 21225
  • Country: gb
  • Numbers, not adjectives
    • Having fun doing more, with less
Re: what is the most relevant programming language for ee?
« Reply #19 on: November 04, 2018, 11:36:18 am »
Don't focus on the language; they change regularly and will continue to change throughout your career.

Not really. I first programmed in C in 1983 and C++ in 1988 and those are still what 95% of my work in operating systems, compilers and interpreters and JITs, runtime libraries, and embedded programming use, 30 to 35 years later.

Most of the other 5% is bash/grep/sort/etc/perl. Perl is 30 years old and Perl 5 24 years. The unix utilities are 35 to 40+ years old.

And I do all my editing in emacs. It's similar vintage.

I'd say you can't go wrong learning those tools. They're going to be here forever, even if there is something else that comes into popularity from time to time.

First point: those languages have changed very significantly over the years. (I first programmed C in, IIRC, 1982 :) )

Second point: while they might be not inappropriate for the work you have done, there are alternatives with some advantages.

Third point: they are an inappropriate and/or a waste of time for many applications - see the list I gave. (Or maybe you really think it would be best to do statistical analysis or analyse analogue circuits in C!)

Fourth point: by concentrating on one tool/technology, you are limiting your future options. Technologies do become obsolete; I was once offered a job based around core memory! If you are the world expert in, say, CCDs, you will be very well paid until your employer is no longer interested in CCDs :)

Fifth point: if you know alternative tools and strategies, they can improve your designs and implementations even if you use a different language. FSMs in C are the canonical example, e.g. see this current topic: https://www.eevblog.com/forum/microcontrollers/state-machines-is-this-topic-taught-any-more/msg1931161/#msg1931161
There are lies, damned lies, statistics - and ADC/DAC specs.
Glider pilot's aphorism: "there is no substitute for span". Retort: "There is a substitute: skill+imagination. But you can buy span".
Having fun doing more, with less
 

Offline emece67

  • Frequent Contributor
  • **
  • !
  • Posts: 614
  • Country: 00
Re: what is the most relevant programming language for ee?
« Reply #20 on: November 04, 2018, 11:37:08 am »
.
« Last Edit: August 19, 2022, 02:04:14 pm by emece67 »
 

Offline tggzzz

  • Super Contributor
  • ***
  • Posts: 21225
  • Country: gb
  • Numbers, not adjectives
    • Having fun doing more, with less
Re: what is the most relevant programming language for ee?
« Reply #21 on: November 04, 2018, 11:56:45 am »
Although, after a long career all we have used many different tools, the OP defines himself as a 2nd year EE student that has taught a little bit of C and is asking about "what to do now?". I think that overwhelming him with a huge list of, otherwise, valuable tools is not really useful.

My advice, learn C. After C, learn any OO language (C++ or Java seem the wisest elections to me). Then... well, it depends on the way your career gets developed over the years. Maybe you turn on needing HDLs, or number-crunching, or easy scripting, or real-time, or regular expressions or... time will know.

Yes, but...
  • the OP needs to understand that EE is a large field and that no one language is sufficient. He will have to choose which to ignore, based on his (unstated) interests
  • he is at an age at which he can learn easily
  • many people stick with the first tool they learn, thus limiting the quality of what they produce and limiting career options
  • it is necessary to realise that you will need more than one tool, so get an appreciation of their advantages and disadvantages
  • knowing when to use/avoid a tool is a very good discussion point in job interviews
There are lies, damned lies, statistics - and ADC/DAC specs.
Glider pilot's aphorism: "there is no substitute for span". Retort: "There is a substitute: skill+imagination. But you can buy span".
Having fun doing more, with less
 

Offline Karel

  • Super Contributor
  • ***
  • Posts: 2275
  • Country: 00
Re: what is the most relevant programming language for ee?
« Reply #22 on: November 04, 2018, 12:12:27 pm »
C language is the most important language for EE's.
Apart from that, it's the second most used language in the world. Only Java is more popular.

Once you have mastered C, you will have a very good understanding of programming in general and
you will have no problems to learn other langauges in case that's needed.

Personally, I would never hire an embedded engineer who doesn't understand the concept of
pointers to pointers.
 

Offline IanMacdonald

  • Frequent Contributor
  • **
  • Posts: 943
  • Country: gb
    • IWR Consultancy
Re: what is the most relevant programming language for ee?
« Reply #23 on: November 04, 2018, 03:35:00 pm »
Personally, I would never hire an embedded engineer who doesn't understand the concept of
pointers to pointers.



Personally, I would never hire a bench engineer who thought that wrapping tinfoil round fuses or splicing cables with tape were good ways to repair things.

Something over half of all IT security issues are due to programming with pointers. (and forgetting the small issue of bounds checks) The cost of this practice in terms of downtime and stolen data outweighs by orders of magnitude any advantage.

 

Offline Karel

  • Super Contributor
  • ***
  • Posts: 2275
  • Country: 00
Re: what is the most relevant programming language for ee?
« Reply #24 on: November 04, 2018, 04:09:31 pm »
Something over half of all IT security issues are due to programming with pointers. (and forgetting the small issue of bounds checks) The cost of this practice in terms of downtime and stolen data outweighs by orders of magnitude any advantage.

You have to blame the programmers or their bosses who put tight deadlines and/or
don't want to pay for an experienced C programmer.

I have learned to always:

- check all input
- use Valgrind
- use unittests

I have seen many that skip those because of lack of time.
« Last Edit: November 04, 2018, 04:12:00 pm by Karel »
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf