Why I think all engineers should learn to code

From a young age, I’ve had an insatiable curiosity about computers. More recently, I’ve been pleased to discover that while working as an engineer this is quite useful. In this blog, I’d like to explain why I think computer skills are now vital for the role and suggest some ways that others might begin to improve their own skills – without feeling like they’re starting over and learning a whole new profession.

Introducing the problem

Broadly speaking, I would say the role of an engineer is to creatively apply mathematics and scientific principles to solve problems, based on an understanding of the problem context and domain. Thinking back to the 1980s (or the 1890s!) an engineer’s role would have involved a lot of hand calculations, requiring a firm understanding of these principles and the context in which they were being applied – and probably a fair amount of creativity too!

Living in the 21st century, the problems that we’re faced with often require more complex solutions. In such a competitive world, a heavy-handed Victorian design approach is certainly not going to win any tenders. The role of the engineer now often involves conducting complex calculations/simulations, with a few prominent water-related examples being:

  • Hydraulic network models
  • Computational fluid dynamics
  • Finite element analysis

We are increasingly at the mercy of computers to perform these calculations for us. Unfortunately, this could lead to complacency that the computer just gives us the right answer. If we have an idea of what we’re doing and the right software package for the job that might be the case, but does this pose a risk that the role of an engineer might inadvertently be reduced to just data entry? Moreover, being too reliant on off-the-shelf software solutions puts a big constraint on us and our creativity!

Opportunity

With these changing times, more and more tools (Python being a notable example) are becoming available to make communicating our intentions to the computer more accessible. Besides dealing with complex calculations, there’s also great value in establishing automated processes which might build upon simpler concepts, yet still save us a great deal of time and human effort. In other words, the skill of communicating problems to a computer (which can solve them quickly for us) is becoming increasingly essential. Therefore, as an engineer, the better you are at programming and software development principles, the better you are at your job.

Please don’t take this as an insult. Engineering roles come in all sorts of varieties and I’m painting them here with a broad brush. For example, an engineer responsible for a defined maintenance process in a large turbine manufacturer might have a well-established workflow which doesn’t call for much innovation. But if your role presents a variety of problems requiring creative, technical solutions, then computer and programming skills are invaluable.

If we want to be able to solve new problems, push boundaries, or otherwise approach things in a new way, we need the help of computers. So, what can we do to get them on our side?

What (or maybe not) to do: How I got started

As an engineer wanting to improve your computer and programming skills, what can you do to begin taking steps in the right direction? This can be quite daunting, and realistically the answer probably depends a lot on the opportunities within your current role.

Personally, I count myself lucky to have begun my professional career with a company making heavy use of relational databases. Almost by necessity, this allowed me to take baby steps into using SQL to access and manipulate the data I needed to analyse for my project work. The company also made heavy use of spreadsheets for analysis, and some engineers had noticed that they could both save time and do more interesting things with them by leveraging the built-in VBA (Visual Basic for Applications) programming language, which Excel uses for macros.

Gaining experience with both SQL and VBA, I soon realised that combining the two would allow me to write my own applications to perform more complex analysis on our data. And boy, did I make some mistakes doing it! Fortunately, though, mistakes are perhaps the best way to learn and the headaches I endured then set me up well for the years to come. To be clear, I’m not advocating VBA as an ideal inroad to programming! It’s an accessible way to gain early exposure to some key concepts, such as iteration and functional programming, but by today’s standards is quite primitive and so, in a sense, is a step back to (almost) the 1980s.

What to do: Back to the future

What I’m advocating is that we should make the most of the opportunities we have to expand our breadth of experience with computers in our current role. Having graduated from Visual Basic, I found myself well-placed to begin using Python to do some much more interesting work (and with far fewer headaches). The messy and complicated SQL queries I had to work with also forced me to learn more about important concepts (e.g. keys, indexing and transactions) and set me on a path to eventually become a competent database admin, and to use databases to do some pretty clever stuff with PostgreSQL.

As a business we’re seeing success in building our own software components with Python (which has a vast portfolio of freely available libraries) and with other open-source tools, such as PostgreSQL and its fantastic PostGIS extension for spatial data. If you have at least an interest in working with spatial data, I can’t recommend PostGIS enough as an entry point (the only pre-requisite being some basic SQL skills). The tutorial available in its documentation is a great resource, and also quite entertaining (if a little morbid), as it has you plotting and investigating the spatial distribution of homicides in NYC!

In conclusion

Whatever path you end up taking, I hope that reading my experiences has made it seem a little less daunting. The key is to understand that learning to create your own software solutions isn’t necessarily one big hurdle to overcome – it can be a series of baby steps. The most important thing is that you have the curiosity to get started.

Related articles