Which programming language should I learn?

Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
7 replies · 4K views
Dauden
Messages
42
Reaction score
0
I'm going for a major in mechanical engineering and am planning on getting a PhD. I was planning on having a minor in Computer Science just to help with research and general programming.

With all of the programming languages out there, it gets kind of overwhelming when trying to narrow it down to one language. I've seen that Fortran is described as an engineering language but my school requires you to take a programming class in C++ to graduate with an Associates in engineering (I already took that class).

Any insight would be appreciated.
 
Physics news on Phys.org
I would learn either Java or C# which are object oriented, perform well for calculations, and are a heck of a lot safer to use for the average programmer than C++. In the "real world", one probably only needs C++ if doing systems programming (on a computer operating system) or extreme multimedia as in computer games. Otherwise, for physics type calculations, you'll be a lot happier in the long run equipping yourself with a language that does automatic garbage collections and has well-behaved objects without the hazards of multiple inheritance and broken pointers.
 
The advantage of C/C++ is that most libraries are written in C or can easily link to it.
The other popular choice is python, it has a lot of scientific library support and links easily with c libs
 
What happened to he other posts in this thread (I made one)
 
harborsparrow said:
I would learn either Java or C# which are object oriented, perform well for calculations, and are a heck of a lot safer to use for the average programmer than C++.
You wouldn't if you were studying engineering. C++ is essential for the sciences, everything else is secondary. Just about all current work is developed in C and C++. Unless you're up for the job of rewriting decades of library development in C#, you don't have much choice. The situation may change, but if it does it will change very slowly.

My suggestion would be learn C++ and learn it well. Then learn a scripting language such as Python, which will be quick and easy if you know C++. This way you have the essential foundation for engineering work, and you have the high level language which comes in handy everywhere else (prototyping design ideas, etc).
 
I first learned C++ during my first semester in college. I have now been playing around with visual basic(for applications) or VBA its pretty nice. I know its not as powerfull as c++, but if you have excel you can do some cool stuff. I had a professor who swears by excel and VBA. He is mainly a heat transfer guy and has used excel/VBA to model 3-D heat tranfer amoung other things. I have been working on developing an application to numerically solve n-body gravitational problems. The language is different that c++ but certain things feel pretty similar. Anyway I would still take c++ it makes it easier to learn a new language.