If so what woukd be the best program to code , c++, Java, Visual Basic, Python etc?
Learning how to code is beneficial to nearly everyone, including mechanical engineers. Which language is less important as long as you understand the basics of coding. You can always pick up new languages. Probably the most generally useful code for a mechanical engineer would be Python due to its libraries that let it do the same sorts of numerical analysis handled by Matlab, which will be more broadly applicable to mechanical engineering.
Maybe it’s just semantics, but don’t learn to code… learn to program.
Python or Matlab are good ones to start with for any would-be engineering major.
What’s the difference between coding and programming?
I would say start with programming visual basic for applications with your Microsoft Office products. It seems those programs are used everywhere and there’s also some engineer who came up with a nifty Excel or Access program. Some of the other languages could certainly be more useful, but would not be used as widely as VBA in the workplace.
Coding vs. Programming can be semantics for some folks. But I take this to mean the difference between being able to write code that works for a given language (coding) and understanding the fundamental concepts of good programming, which can apply across any language (programming). Also knowing the right concepts of programming so you use the best option at hand for optimal system performance and to make for better and more easily maintained code. Some day you will need to maintain your code, or someone else’s code, and the better written it is the better for maintenance.
If you want to write codes for robot and electronic control (big part of mechanical engineering) then C/C++, Python, and Java are the most common languages.
MATLAB, the language for calculation, simulation in mechanical engineering is also useful. You are probably required to use MATHLAB in college.
http://blog.robotiq.com/what-is-the-best-programming-language-for-robotics
There’s absolutely no reason to buy a Matlab book. That’s a waste of money. You can get everything you need to learn for free online. Except for the software itself.
^ I agree not to buy now. I just want to show the OP MATLAB is widely used by ME.
My son received free MATLAB software in the past. MATLAB software is also provided by colleges.
I agree with boneh3ad that the type of language is not important, but just understanding the logic of computer programming. After you got the basics down, it’s merely understanding the different functions and nuances of other languages.For me, I started with C++ and was able to pick up Matlab as it was widely used in my ME classes.
Now that I’ve been out of school for awhile, I haven’t done much hardcore computer coding as I did in college. It really depends on the job that you get. Once in awhile I have to manipulate an excel spreadsheet with macros that someone created years ago. I never really used VBA in college, but since I understand the logic of computer programming I can jump in the vba code with the help of google and modify as needed.
It’s not a well-defined, agreed-upon distinction, but generally “coding” denotes simply writing code, possibly mindlessly (see the term “code monkey”), whereas “programming” refers more to understanding the logic and architecture behind programs and applying it to writing code. Learn principles of programming, and it becomes relatively easy to learn another programming language and start coding in another language.