Image Image Image Image Image Image Image Image Image Image

Being Brunel |

Scroll to top

Top

One Comment

Programming Languages For Engineers

Programming Languages For Engineers

Last weekend someone asked me what programming language they should learn, and I unhelpfully responded with “it depends”. And it does- if I asked you what material I should learn to design with, you’d probably say something similar. The fact is, the reason there’s so many different programming languages is not (as it may first appear) to bewilder the uninitiated, but because they all solve different problems for different people.

However, there aren’t such things as stupid questions, just stupid answers. So in today’s post I’m going to attempt to answer the question by outlining three common things engineers looking to program want to do, and making a recommendation as to what you should go about learning. Obviously there are always different answers if you ask different people, but if we could save time and just agree I’m right- that’d be grand.

Automation and Desktop Tools: C#

The majority of programs used by engineers are desktop applications. Automating and writing tools to make your life easier on a day to day basis must be the main thing I find engineers are trying to achieve when they first start programming. Although this often manifests itself as intricately crafted Excel macros, sooner or later you’re going to want to move on- and that’s when I recommend you find C#.

So why C# (pronounced C Sharp)? Well for a start, most of the applications you use on a daily basis will have a C# interface- Rhino, Excel, Revit, SAP/ETABS, etc. This means that you can write your own tools to drive, process and transfer data between programs– a very common use case for automating engineering tasks. It also has support for Web APIs and COM; capturing the way the other 10% of programmable applications communicate.

C# is primarily a windows language, so developing desktop applications is relatively straight forward. It is a high-level language and also sits on top of something called the .NET Framework, which means you get a lot of functionality out of the box. Finally, it is the only language on this list that is compiled ahead-of-time, which means that you’ll benefit from being able to identify most errors before you run your application.

Scientific Applications: Python

I’m already talking about Python in another series, but the fact remains that for whatever reason the scientific community love a bit of Python. Because of this, regardless of what you think about the language itself (and Python does have its fair share of eccentricities), the massive number of fantastic scientific and mathematical libraries that are being created by its community automatically makes is a great language for these applications.

So why Python? Well, it’s incredibly tolerant, which makes it ideal for prototyping and throwing together code to see what you can get working. However, you can say that about a lot of languages. Where Python really shines is third party libraries like NumPy, SciPy, DEAP, etc. that provide fast and stable implementations of many common and cutting-edge algorithms and methods. With access to these it can become incredibly easy to solve complex problems (like writing a Genetic Algorithm in 23 lines of code).

Web/Cross-Platform: Javascript

I hesitate in recommending JavaScript to anybody who doesn’t already know another language, as it is a language of quirks that makes it easy to fall into bad habits. However it is the language of the internet. That means if you want to develop an application that works pretty much anywhere; JavaScript is the language you need to learn.

JavaScript is an odd language, it has nothing to do with Java, and owes its popularity much more to chance than design. Really, the only reason we use JavaScript so extensively is that it pretty much accidentally ended up on every computer after browsers all implemented it. Although it’s something you learn to love eventually, there’s a lot out there to catch the less experienced developer out.

Last year JavaScript had a bit of a revamp (called ECMA2015, or ES6) and I would recommend people new to the language start there and then work backwards. It’s a language of tools (node for servers, npm for downloading third party libraries, babel for transpiling, webpack for compiling), a language of frameworks (react or angular for views, redux for state, d3 for graphing, etc.), and a language of new exciting developments (electron for cross-platform desktop apps, react-native for phone apps, three for 3D websites). And that makes it hard, but incredibly worthwhile, to dip your toe into.


I’ll probably get around to each of these in turn discussing the resources available and any specialist challenges engineering offers them. But until now I hope that’s given you all some where to get started.

Submit a Comment

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Comments

  1. Engineers need programming languages more than even computer scientists to program engineering systems.