Programming language for Mech Engineering (for profession and as hobby)

In summary, the Mech Engineering student is considering three programming languages for use in hobby and work purposes: Python, Ada, and C++. He has used Python for physics and finds it to be a cool language, but is interested in learning more about C++ for when Python is just too slow. He recommends adopting Python and using it for any programming tasks, and adding C++ when needed for the most computation intensive tasks.
  • #1
blynxGT
8
0
Hello,

I am a second year Mech Engineering student. I was co-oping this past spring and was introduced to programming/embedded systems in real life situations. Among this, simulation caught my attention as well. Have decided that it would be great to learn a language so that I can use it for both as a hobby and for augmenting my work skills. I know that the point of any language is to learn the concept and art of programming but I have various interests so I want to know a good programming language that can serve this purpose. I have narrowed it down to three choices personally: C++, Ada, and Python. I've already had a course in MATLAB but wanted to add something else. Well here is my reasoning behind the three:

Python: good easy language to "learn". multiple modules for both scientific and even some plug in graphics engines. Seems to have the best of both worlds since it seems to be well respected both as a hobbyist language and in the scientific community

Ada: I love aerospace and to me Ada seems like a really neat language to learn (not just because of aerospace). It can and is used for embedded systems but has OO capability and similarities to C++. I have seen a couple of 3D engines such a globe 3D written in Ada. It has applications for real-time, embedded and even simulation. Don't know how good it is as a number cruncher though. Also it seems to have not gained any momentum since it was introduced. Mainly used for ATC control, communications, and transportation safety systems.

C++: general all around programming language. Used for simulations and gaming as well as large software apps that Ada is used for. More widely accepted than Ada however. Combines low level memory access with higher level functions. Seems like a good choice but have heard mixed feeling about it in the engineering and science community (i.e. too bloated, design by committee, steep learning curve).

Honestly I have been doing some searching and talking to fellow colleagues at school but I still have yet to decide. I've used Python (well Vpython to be specific) in physics and python seemed cool enough to me. I would really like some input from people at the physics forum. Honestly i think learning how to do a bit of electronics and programming for electronics as well as simulation could go a long way in the future with my Mech Eng degree.
 
Technology news on Phys.org
  • #2
My recommendation is the following:

(1) Adopt Python and use it for any programming tasks you have. It is easy to learn and quick to debug, and has a large library of already-written modules.

(2) At some point you will write some code for which Python is just too slow. At this point, add C++ to your skill set. What I find is that it is not necessary to translate my entire Python code to C++, I just identify the most computation intensive segments and translate these to C++ functions, which I call from Python.

This strategy has served me well for a wide range of computing applications.
 
  • #3
Thank you so much for the input.
 

1. What programming languages are commonly used in mechanical engineering?

The most commonly used programming languages in mechanical engineering are MATLAB, Python, C++, and Java. These languages are versatile and can be used for various tasks such as data analysis, simulations, and control systems.

2. Is it necessary for a mechanical engineer to learn programming?

While it is not necessary for all mechanical engineers to learn programming, it can greatly benefit their career and make them more competitive in the job market. Programming skills can be particularly useful for tasks such as data analysis, automation, and simulations.

3. Can programming be used in hobbies related to mechanical engineering?

Yes, programming can be used in various hobbies related to mechanical engineering such as building robots, 3D printing, and designing mechanical systems. Learning programming can open up more possibilities for creative and innovative projects.

4. Which programming language is best for beginners in mechanical engineering?

For beginners in mechanical engineering, Python is often recommended as it has a relatively simple syntax and is widely used in the field. However, the best programming language for you will depend on your specific interests and goals.

5. How can learning a programming language benefit me as a mechanical engineer?

Learning a programming language can benefit you as a mechanical engineer in many ways. It can help you automate tasks, improve efficiency, analyze data, and create simulations. It can also make you more competitive in the job market and open up more opportunities for career advancement.

Similar threads

  • Programming and Computer Science
Replies
8
Views
867
  • Programming and Computer Science
4
Replies
107
Views
5K
  • Programming and Computer Science
2
Replies
59
Views
7K
  • Programming and Computer Science
12
Replies
397
Views
13K
  • Programming and Computer Science
Replies
11
Views
1K
  • Programming and Computer Science
Replies
16
Views
1K
  • Programming and Computer Science
Replies
9
Views
1K
  • Programming and Computer Science
2
Replies
54
Views
3K
  • Programming and Computer Science
Replies
1
Views
1K
  • Programming and Computer Science
Replies
14
Views
2K
Back
Top