I'm looking to learn a programming language that would be useful to a Mechanical Engineer, for solving iterative problems and the like. I have programming experience in Fortran from quite some time ago, but would basically be starting over if I were to pick it up again. So I find myself wondering if there's a better, more up-to-date alternative. A computer science friend of mine recommended Python because it's so flexible. The romantic side of me wants to learn C++ because it can do so much. Meanwhile the pragmatic side of me says "Learn to program in LabView" since it's sort of an engineer's multi-tool when it comes to interacting with the physical world. Lastly, I have a fair familiarity with Mathematica, which can be used to program. Does anyone have any good recommendations?
First, I recommend Excel. Most of the people doesn't know the abilities of Excel. I design fourbars and similar mechanisms in Excel because just by changing a parameter, I can see all the changes in forms of graphics without typing a single line of code. Excel can also have more complicated algorithms like Newton Raphson method. Just google it and you will be amazed. Besides, MatLab would be a great tool because you can try simple tasks on its workspace without worrying about syntax. And if you want, you can write more complex codes as ".m" files. Matlab can work as an object oriented language if you want. As programming language Phyton would be a good choice. It can work on many platforms. And for Windows, C# is also a very easy to learn language. I personally think that, for a mechanical engineer, C++ is unnecessarily complicated.
Excel (VBasic) is a must for an engineer. You can shorten your time/the time of a process drastically that way. However to be back on your initial questioning, there is not really a language you'd should learn. Boolean laws and algebra is what you'd have to master. Conceptual understanding is what you are looking for. Then converting to one or another is simply peanuts. I have myself written numerous codes without having worked before on that language simply as customer requirement implied me to do so. When you have a strong basis in theory, switching from one to another code is straightforward. Some of my routines are used in the Auto&Aero industry and works well . Understand that Mech Eng are not programmers. We are on a very specific niche in the programming chain: specific, technical and optimized that's what we are required to do. Then, there is real programmer to deal with specific hardware, protocols etc... One that is easy to convert and switch is Fortran. I will go for it.
I agree with some of the comments listed above. Learning Visual Basic for Applications (Excel) is a very useful skill. In addition to automating the calculation, you can also automate the graphing. That's pretty handy and can save you a lot of time. I have used C as a way to interface to the physical world. My understanding of Python is that it is very similar, but not so picky on syntax, so that might be a good place to start. One other detail to consider is cost. Something that offers free versions might be a good way to start.
VB is the usual suggestion, but except for tweaking code written by others, I haven't used it much. I do a lot with Autoit, which started out as a Windows scripting language but has gone far beyond that. The nice thing about Autoit is that you can write standalone apps with it, or interface with other programs to extend their capability.
Matlab with some other high level languages like c/c++/asm/fortran helps you alot and learn Excel as well. Excel makes your tasks easy.
C,C++,Python,Perl etc are good for Engineering but you need also know about database like MS access, SQL etc..