Author Topic: Too many programming languages?  (Read 49051 times)

0 Members and 1 Guest are viewing this topic.

Offline bjdhjy888Topic starter

  • Regular Contributor
  • *
  • Posts: 62
  • Country: ca
Too many programming languages?
« on: September 24, 2019, 12:29:52 am »
When it comes to learning programming languages, I'm often overwhelmed. The currently popular ones include but not limited to C, C++, C#, Java, Python, etc. You name it, you gotta learn them!

I think one should master one specific programming language, rather than being an expert of all.

The thing is, as an electronics engineer, which one should I learn most!?

p.s.: and one programming language's introduction textbook is often as thick as a brick used in the Empire State Building.

  :horse: :popcorn:
« Last Edit: September 24, 2019, 01:21:26 am by bjdhjy888 »
 

Online wraper

  • Supporter
  • ****
  • Posts: 16846
  • Country: lv
Re: Too many programming languages?
« Reply #1 on: September 24, 2019, 12:35:52 am »
For MCU you are basically limited to C (8 bit) and C/C++ (ARM) for any serious use. And then there is Verilog/ VHDL if you want to use FPGA.
« Last Edit: September 24, 2019, 10:45:33 am by wraper »
 
The following users thanked this post: bjdhjy888

Offline Mechatrommer

  • Super Contributor
  • ***
  • Posts: 11622
  • Country: my
  • reassessing directives...
Re: Too many programming languages?
« Reply #2 on: September 24, 2019, 12:36:22 am »
it been discussed many times everybody with opinions... but i tell you only once this time and then no more... if you want to risk obsolescence and have to relearn new language in the future, learn anything other than C/C++ now mix up your mind with what replies that will come... :scared:
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
 
The following users thanked this post: Howardlong, bjdhjy888

Offline RoGeorge

  • Super Contributor
  • ***
  • Posts: 6185
  • Country: ro
Re: Too many programming languages?
« Reply #3 on: September 24, 2019, 12:44:39 am »
The thing is, as an electronics enginner, which one should I learn most!?

C and Python

Offline beanflying

  • Super Contributor
  • ***
  • Posts: 7360
  • Country: au
  • Toys so very many Toys.
Re: Too many programming languages?
« Reply #4 on: September 24, 2019, 01:09:58 am »
As someone who started programming with Basic/QBasic then Fortran and Pascal and punching Hex codes into 6800 Micros it's all easy  :scared:

I got back into programming Micros after a long long time away and like the others C or C+ makes most sense as a gateway to some of the others. Java is maybe on the way down compared to only a few years ago but Python is on my list of really must get some skills in.

Instead of a textbook and killing a few trees grab the Arduino IDE and a starter kit depending on where you already are. Run through the stock bits then come up with a job of your own and start to learn how to write your own. This worked for me and to get the rusty brain wheels turning again. Then kick onto other Micros. None of the skills learned with this step will be wasted moving forward.
Coffee, Food, R/C and electronics nerd in no particular order. Also CNC wannabe, 3D printer and Laser Cutter Junkie and just don't mention my TEA addiction....
 
The following users thanked this post: bjdhjy888

Offline knapik

  • Regular Contributor
  • *
  • Posts: 143
  • Country: au
Re: Too many programming languages?
« Reply #5 on: September 24, 2019, 03:27:11 am »
Definitely learn C as its the must know language for anything related to embedded design.

When it comes to general programming for PCs, languages start to be chosen as the right tool for the right job, so the diversity can be quite handy. Most of the popular programming languages mainly boil down to C-like with object oriented programming built in, so learning C is a good stepping stone.
 
The following users thanked this post: bjdhjy888

Offline MarkF

  • Super Contributor
  • ***
  • Posts: 2539
  • Country: us
Re: Too many programming languages?
« Reply #6 on: September 24, 2019, 03:54:31 am »
Since I started programming in the late 1970's, I have used various assembly languages, Fortran, Ada, C/C++ and some Java.  In the last few years I've seen a call for C/C++ for application work and Java for web based interfaces.

On top of all that are all the different graphic and GUI needs.  The last place I worked at started requiring programs to be written with Qt because they needed to be cross-platform (Windows and Linux).  And don't forget database work is big too.

Most of my work was done on mainframe machines.  Since PCs have grown much more powerful, they are going away except for specialized cases.

I would definitely start with C/C++ and Java for general applications.  Just take a look at jobs being advertised (Indeed for example).


I would say skip the punch cards and paper tape that I had to deal with.   :-DD


Edit:  Programming is logic.  Language is syntax.  Simple...
« Last Edit: September 24, 2019, 03:56:11 am by MarkF »
 
The following users thanked this post: bjdhjy888

Offline CatalinaWOW

  • Super Contributor
  • ***
  • Posts: 5226
  • Country: us
Re: Too many programming languages?
« Reply #7 on: September 24, 2019, 04:34:29 am »
There are too many languages.  But it is the way it is so you will have to deal with it.

1.  Once you have learned one procedural language the others will come relatively easy.  Don't fret too much over which one you learn first.

2.  They are all hard unless you sit down and code in them.  Few people can learn any of these languages by reading a book.  That means that a language fits your current situation should be your first language.  Whether it is a programming course in school, a lab in school, a work project or a hobby project the need to generate code to solve your problem will force you to learn the language at hand, and most of these situations come with a predefined language requirement.

3.  Your later languages will follow this pattern - you will pick them up as needed for the current task.  Even within a language you will be relearning different flavors as time goes on. 

If these methods still leave you unsure where to start you can do worse than to start with either Python or C.  Both have broad application in engineering and will likely be around for at least a decade or two more, giving you plenty of time to learn whatever might displace them.

 
The following users thanked this post: bjdhjy888

Offline techman-001

  • Frequent Contributor
  • **
  • !
  • Posts: 748
  • Country: au
  • Electronics technician for the last 50 years
    • Mecrisp Stellaris Unofficial UserDoc
Re: Too many programming languages?
« Reply #8 on: September 24, 2019, 04:49:54 am »
When it comes to learning programming languages, I'm often overwhelmed. The currently popular ones include but not limited to C, C++, C#, Java, Python, etc. You name it, you gotta learn them!

I think one should master one specific programming language, rather than being an expert of all.

The thing is, as an electronics engineer, which one should I learn most!?

p.s.: and one programming language's introduction textbook is often as thick as a brick used in the Empire State Building.

  :horse: :popcorn:

It depends on what you want to do. You said you're a electronics engineer so I'll assume you meant embedded control.

This is a contentious and flame prone question, and no doubt will soon devolve into rants, fud and being closed by the admins, especially if one offends the Gods of C, but before it gets that far I recommend :-

Low level you can't beat Forth
High level you can't beat Forth

So my advice is Forth. It's not 'popular' like C, but it's simple enough that you can learn all of Forth and even write your own Forth in a decade or so providing you put in some effort every day. After that you can hold the entire concept in your head.

You will need to be fluent in Assembler for your chip type(s) but you can learn Assembler as you learn Forth, they compliment each other.

It's quite unlikely you can learn all of C and write your own comprehensive C compiler in that same time frame.

Here is a  Forth sample: I recommend asking other programming language advocates to submit their code for this same task so you can compare them. Note I didn't need any libraries, there are no hidden include files, everything is present here for a STM32F0xx, Cortex-M0 MCU.

This Program calculates baudrates by reading the MCU configuration. Only works with USART1 16 bit oversampling which is the reboot default and will exit if 8 bit oversampling is in use.

It uses Mecrisp-Stellaris s31.32 fixed point support to calculate the Baudrate to two decimal places so you can choose the best BRR integer to use when setting up your terminal baudrate.

More information about Forth is available in my SIG below.

................... start.................
 $40021000 constant RCC ( Reset and clock control )
 RCC $4 + constant RCC_CFGR ( Clock configuration register  RCC_CFGR )
 $40013800 constant USART1 ( Universal synchronous asynchronous receiver  transmitter )
 USART1 $0 + constant USART1_CR1 ( Control register 1 )
 
 8000000 constant clock  \ default, change if not.
 : rcc_cfgr_pllmul? ( -- ) %1111  18  lshift $40021004 @ and 18 rshift ;  ( PLL Multiplication Factor )

 : clock_multiplier? ( -- ) RCC_CFGR_PLLMUL? 2 + ;  \ clock multiplier value

 : usart1_cr1_over8? ( oversampling8? -- true )  %1 15 lshift usart1_cr1 bit@ ;  \ oversampling mode. reboot default: 16

 : oversampling? ( -- )
   usart1_cr1_over8?  if ." USART: 8 bit oversampling ! MUST use 16 bit oversampling" exit then
 ;

 : >s31.32 ( u -- s31.32 ) 0 swap ;     \ convert to a s31.32 number   

 : brr? ( desired baud rate -- brr )              \ brr =  ((pll multiplier * clock)/desired baud)/2
   >r
   clock_multiplier?  clock *  >s31.32     \ calculate bus clock, convert to s31.32
   r@ >s31.32                             \ desired baud rate
   f/                                       \ f. divide
   2  >s31.32                            \ last step is divide by 2
   f/                                      \  f. divide
   2                                     \ only display 2 comma places
   ." for a baud rate of " r> . ." the usart1_brr should be: " f.n cr
 ;

 : baud?  ( -- ) cr cr
   oversampling?
   ." CLOCK: " clock . ." PLL multiplier: " clock_multiplier? . ." BUS CLOCK: " clock clock_multiplier? * . ." Hz " cr
   115200 brr?
   460800 brr?
   921600 brr?
   1843200 brr?
   cr 
 ;

......... end............

\ Output
\ baud ?
\
\ CLOCK: 8000000 PLL multiplier: 6 BUS CLOCK: 48000000 Hz
\ for a baud rate of 115200 the usart1_brr should be: 208,33
\ for a baud rate of 460800 the usart1_brr should be: 52,08
\ for a baud rate of 921600 the usart1_brr should be: 26,04
\ for a baud rate of 1843200 the usart1_brr should be: 13,02
 

Offline MarkF

  • Super Contributor
  • ***
  • Posts: 2539
  • Country: us
Re: Too many programming languages?
« Reply #9 on: September 24, 2019, 05:53:39 am »
I'm sorry.  But I have never seen a military or commercial contract that requested Forth be used.
I worked for someone years ago who loved Forth solely for how much he could do in 'one' line of code. 
@techman-001 appears to be another.  Not a reason to invest time learning Forth.

And as far as Assembler, you would have to be doing something very very critical NOT to use a higher level language.  Even for todays microcontrollers. 
The customer will always opt for the 'readability' and 'long term support' of a high level language. 
I have seen 5000+ line Assembly programs.  It is NOT going to happen any more.


Unless it is for a home project.  Then have at whatever suites your fancy.
If you are looking for a career, stick with the main stream languages.
 
The following users thanked this post: Howardlong

Offline Berni

  • Super Contributor
  • ***
  • Posts: 4946
  • Country: si
Re: Too many programming languages?
« Reply #10 on: September 24, 2019, 05:58:34 am »
As others have said C

Not only is it a popular language that is similar in syntax to a lot of others, but it also teaches you a lot of low level things about how computers work, yet is high level enough to be useful for large projects.

If you are going to be programming modern microcontrollers you are going to be using C/C++ because this is what everyone else uses.

If you are going to be programing for PCs then the choice is a lot more broad as the resource hunger of bigger languages is not a problem due to how powerful PCs are. There you might be looking at C#, Java, Python... And if you work with web applications then also PHP, Javascript, Ruby...
 

Offline tggzzz

  • Super Contributor
  • ***
  • Posts: 19468
  • Country: gb
  • Numbers, not adjectives
    • Having fun doing more, with less
Re: Too many programming languages?
« Reply #11 on: September 24, 2019, 07:55:10 am »
When it comes to learning programming languages, I'm often overwhelmed. The currently popular ones include but not limited to C, C++, C#, Java, Python, etc. You name it, you gotta learn them!

I think one should master one specific programming language, rather than being an expert of all.

The thing is, as an electronics engineer, which one should I learn most!?

You should learn the concepts, advantages and disadvantages of one example of each type of programming language. That will enable you to choose the right tool for the job, just as you should know whether to use screws, or nails, or bolts. Once you know the concepts, picking up the next language of that type is simple.

So, what types are there?

Procedural: C is the best choice.

Object Oriented: Java is the best choice, C# is a me-too version of Java, C++ is an abortionate mess where knowledgable people spend a lot of time arguing over what ought to happen. Neither Java nor C# are for embedded applications.

FPGA: either Verilog or VHDL.

Multicore/multithreaded: xC for embedded, since that has the only decent theoretical and practical pedigree - and its concepts appear in more mainstream languages.

Statistics: I'll leave others to comment.

General purpose "get answers soonest": Python.

System simulation: that entirely depends on the application domain, and you won't have much choice.
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: Sal Ammoniac, bjdhjy888

Offline GeorgeOfTheJungle

  • Super Contributor
  • ***
  • !
  • Posts: 2699
  • Country: tr
Re: Too many programming languages?
« Reply #12 on: September 24, 2019, 08:31:20 am »
 :popcorn:
The further a society drifts from truth, the more it will hate those who speak it.
 
The following users thanked this post: knapik

Offline techman-001

  • Frequent Contributor
  • **
  • !
  • Posts: 748
  • Country: au
  • Electronics technician for the last 50 years
    • Mecrisp Stellaris Unofficial UserDoc
Re: Too many programming languages?
« Reply #13 on: September 24, 2019, 10:08:53 am »
I'm sorry.  But I have never seen a military or commercial contract that requested Forth be used.
I worked for someone years ago who loved Forth solely for how much he could do in 'one' line of code. 
@techman-001 appears to be another.  Not a reason to invest time learning Forth.

And as far as Assembler, you would have to be doing something very very critical NOT to use a higher level language.  Even for todays microcontrollers. 
The customer will always opt for the 'readability' and 'long term support' of a high level language. 
I have seen 5000+ line Assembly programs.  It is NOT going to happen any more.


Unless it is for a home project.  Then have at whatever suites your fancy.
If you are looking for a career, stick with the main stream languages.


There is no need to be sorry, the OP didn't mention "military or commercial contracts" or even career, this is all you. I do note that you have left out "space". This is a list of 64 space/military projects that featured Forth.  https://www.forth.com/resources/space-applications/

The OP  asked "The thing is, as an electronics engineer, which one should I learn most!?".

I think you need to start a new topic if you want to argue against Forth.
 

Offline Howardlong

  • Super Contributor
  • ***
  • Posts: 5317
  • Country: gb
Re: Too many programming languages?
« Reply #14 on: September 24, 2019, 10:45:36 am »
I'm sorry.  But I have never seen a military or commercial contract that requested Forth be used.
I worked for someone years ago who loved Forth solely for how much he could do in 'one' line of code. 
@techman-001 appears to be another.  Not a reason to invest time learning Forth.

And as far as Assembler, you would have to be doing something very very critical NOT to use a higher level language.  Even for todays microcontrollers. 
The customer will always opt for the 'readability' and 'long term support' of a high level language. 
I have seen 5000+ line Assembly programs.  It is NOT going to happen any more.


Unless it is for a home project.  Then have at whatever suites your fancy.
If you are looking for a career, stick with the main stream languages.


There is no need to be sorry, the OP didn't mention "military or commercial contracts" or even career, this is all you. I do note that you have left out "space". This is a list of 64 space/military projects that featured Forth.  https://www.forth.com/resources/space-applications/

The OP  asked "The thing is, as an electronics engineer, which one should I learn most!?".

I think you need to start a new topic if you want to argue against Forth.

Forth (and derivatives) has definitely been used extensively in space applications in the last century, but I'm not sure how much nowadays. Key was that it allowed for compiled high performance code in space and performance constrained systems, at a time when C was relatively young and lacked cross compilation tools for such limited systems.

Me, I haven't touched Forth with a vengence since the 1980s, although around 1999/2000, I had some cursory involvement in an aerospace project that used it because it had a proven heritage in space. Re-use of apparently ancient put proven hardware and software designs and parts happens quite extensively in aerospace as a means of risk mitigation.
 

Offline techman-001

  • Frequent Contributor
  • **
  • !
  • Posts: 748
  • Country: au
  • Electronics technician for the last 50 years
    • Mecrisp Stellaris Unofficial UserDoc
Re: Too many programming languages?
« Reply #15 on: September 24, 2019, 11:05:38 am »

Forth (and derivatives) has definitely been used extensively in space applications in the last century, but I'm not sure how much nowadays. Key was that it allowed for compiled high performance code in space and performance constrained systems, at a time when C was relatively young and lacked cross compilation tools for such limited systems.

Me, I haven't touched Forth with a vengence since the 1980s, although around 1999/2000, I had some cursory involvement in an aerospace project that used it because it had a proven heritage in space. Re-use of apparently ancient put proven hardware and software designs and parts happens quite extensively in aerospace as a means of risk mitigation.

You're absolutely right of course, spacecraft do demand proven systems, and because Forth was there *first* it has the oldest proven systems. The cost of spacecraft failure is always astronomical  ;)

It's all well and good to have the latest "mega libraried, C++ syntax sensitive, self healing, quantum phase locked Arduino Meravigliarsi" but if it's not radiation hardened and spaceflight proven, who will risk a billion dollar spacecraft on it ?

There were eight Forth MCU's on the 100kg  "Philae Lander" that landed on Comet 67P/Churyumov-Gerasimenko in 2014, tho it was launched in 2004.


 

Online SiliconWizard

  • Super Contributor
  • ***
  • Posts: 14445
  • Country: fr
Re: Too many programming languages?
« Reply #16 on: September 24, 2019, 03:24:20 pm »
When it comes to learning programming languages, I'm often overwhelmed. The currently popular ones include but not limited to C, C++, C#, Java, Python, etc. You name it, you gotta learn them!
(...)
The thing is, as an electronics engineer, which one should I learn most!?

I suppose you mean embedded software dev, if you strictly talk about "electronics engineer" work. And even mostly dev on low-level targets such as MCUs or DSPs. (Of course an EE could be developing software for higher-level targets, but that's kinda off-topic. How much electronics is there left in that? You could also be an EE an be baking bread.)

So, with this in mind, there are actually NOT too many prog languages around, as many have already pointed out. For serious work in real industrial environments. So no need to be overwhelmed really. If you're feeling overwhelmed here, it's probably just because you're suffering from listening too hard to the hype, and not to what gets work done in real professional life.

 :horse:
 

Offline legacy

  • Super Contributor
  • ***
  • !
  • Posts: 4415
  • Country: ch
Re: Too many programming languages?
« Reply #17 on: September 24, 2019, 03:39:47 pm »
Statistics: I'll leave others to comment.

"R" (yup, "the R language", so it's called) and Matlab :D

p.s.
Mission Critical network applications and databases: erLang!
 

Offline legacy

  • Super Contributor
  • ***
  • !
  • Posts: 4415
  • Country: ch
Re: Too many programming languages?
« Reply #18 on: September 24, 2019, 03:41:37 pm »
Embedded Games: eLUA!
 

Offline Nusa

  • Super Contributor
  • ***
  • Posts: 2416
  • Country: us
Re: Too many programming languages?
« Reply #19 on: September 24, 2019, 06:52:27 pm »
There is no obligation to learn all the languages. The important thing is that you have a solid foundation in the concepts and principles of programming. When you do need to become competent in another language, much knowledge is transferable from languages that you do know. The bulk of programming expertise is in knowing how to plan and solve the problem in front of you. The language is merely a tool to express your solution.

Similarly, if you're designing circuits, you don't need to know all the CAD packages. One is sufficient, until you have some overriding need to master another one. And that's just details, you already know the principles of making schematics.
 
The following users thanked this post: CatalinaWOW

Offline rstofer

  • Super Contributor
  • ***
  • Posts: 9889
  • Country: us
Re: Too many programming languages?
« Reply #20 on: September 24, 2019, 08:37:14 pm »
In my view, the ordering is C, MATLAB and Fortran.  C++ and Java are at the bottom of the pile.

If you're going to design uC systems, C is the main language.  There may be some C++ around the edges so you might need to understand that version as well.

If you're going to do ENGINEERING, with numbers, charts and graphs you will need MATLAB.  There isn't much you can't do with MATLAB including interfacing with an Arduino (and the idea is workable on other processors).  System simulation is also a feature.  I REALLY like MATLAB.

Fortran - some days you just want to play with numbers.  There's a reason that a lot of scientific work is still done in Fortran, more than 60 years since it was introduced.  If you want to play with formulas, it is a great way to get it done.  There's an enormous code base written in Fortran.

 
The following users thanked this post: bjdhjy888

Offline bjdhjy888Topic starter

  • Regular Contributor
  • *
  • Posts: 62
  • Country: ca
Re: Too many programming languages?
« Reply #21 on: September 25, 2019, 12:30:40 am »
haha, MATLAB is indeed very sexy. I'm learning it.
wait, ain't it a product with commands? but not a programming language?
 :-DD
 

Offline bjdhjy888Topic starter

  • Regular Contributor
  • *
  • Posts: 62
  • Country: ca
Re: Too many programming languages?
« Reply #22 on: September 25, 2019, 12:33:55 am »
My purposes of learning programming languages:

1. To make my STM32 IMU project.
          - Schematic and PCB layout done.
          - Parts soldered
          - Troubleshooting its I2C to read RX data on my terminal window  :palm:

2. To make a game like Diablo III.
          - Do I learn C, C++ to make it? I know, it's a huge project.  :P

« Last Edit: September 25, 2019, 12:35:28 am by bjdhjy888 »
 

Offline Fungus

  • Super Contributor
  • ***
  • Posts: 16640
  • Country: 00
Re: Too many programming languages?
« Reply #23 on: September 25, 2019, 01:01:46 am »
For MCU you are basically limited to C (8 bit) and C/C++ (ARM) for any serious use.

Arduinos are programmed in C++, they're 8 bits.  :popcorn:

 

Offline westfw

  • Super Contributor
  • ***
  • Posts: 4199
  • Country: us
Re: Too many programming languages?
« Reply #24 on: September 25, 2019, 01:22:12 am »
Quote
Multicore/multithreaded: xC for embedded
Maybe still Fortran, if you want fancy math parallelized :-(
Be aware that for many languages, there is a subset of features used that is actually quite small, but the knowledge you'll need is more about standard and commercial libraries than the language itself.  (and I'm talking about things like "QT" and "beautifulSoup", not "STL" or "Posix."   Being able to program a cell-phone app is all about understanding the services available and the libraries to access them, rather than Swift vs Java or whatever (at least, as far as I've been able to tell.)  Being able to program deep embedded applications is more about understanding bare metal and critical timing, and being able to program complex physics is about understanding the math.)
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf