Take Your Engineering Skills to the Next Level: Teach Yourself to Code

Code Image, Colin Article.jpg

By Colin Bateson, Ph.D.

Automation. It’s a big word in our professional and personal lives these days, and for good reason. Finding opportunities to focus our time on the special skills or activities that make each of us successful usually means cutting time from something else. Automation is one way to bolster the time available to us, and in the life of an engineer, that means knowing how to code.

While computer programming might not be the first place an engineer would look to bolster their skill-set, there are four central reasons why all engineers should develop their programming skills:

  1. Save time.

  2. Increase productivity and effectiveness.

  3. Gain insight into how your software tools work and make you a more proficient user.

  4.  Experience the satisfaction of kicking back and watching your computer churn out hours—or even days—of your work in a fraction of that time. 

Of course, this sounds great! Who wouldn't like these things? But how does learning to program save time for someone like a mechanical engineer? 

Automate Tasks – Embrace Automation!

For anyone outside the field of software engineering, leveraging scripted tools effectively means identifying the right tasks and then learning how to make the computer do them for you.

Computers are best suited for doing a large number of repetitive tasks very quickly. Anytime I come across a task that is repetitive or methodical—something that I might be able to write down like a recipe—I consider automating the task by writing a short computer program, or script, that I run instead.

As a mechanical engineer, I was first exposed to the power of programing in a heat transfer class in college. My professor loved using Excel to model one- and two-dimensional heat transfer. I considered myself to be an Excel wizard at the time, but when he opened up the VBA (Visual Basic for Applications) editor and showed us how he solves transient heat transfer equations with his custom-written Excel macros, my life as an engineer changed forever. He opened my eyes to the possibility of customizing powerful software tools to fit my specific needs.

4 Easy Tips to Enhance Your Programming Ability

  1. Leverage your favorite search engine. A lot of programming or learning a new language or figuring out the details of a specific syntax is all done with a quick internet search. For example, Stack Overflow is an invaluable resource. Someone has probably already run into your same problem and has published about it online. Don't reinvent the wheel; “Just Read the Instructions” instead.

  2.  Take a basic programming class. If you didn't take any computer science classes in school (the CS 101 class most engineers take is plenty), don't worry. There are plenty of online options where you can take an introductory class for free. Check out www.edx.org if you’re interested. You just need some basic knowledge about what a FOR loop is, or an IF-ELSE statement, or a DO-WHILE loop. The goal is to know that these programming flow control structures exist so an internet search can jog your memory about when they're useful and how to construct one.

    And if there's one thing my CS101 class really drove home, it's that syntax is everything when it comes to programming. Once you know that you need to pay attention to syntax, the internet becomes a powerful tool for figuring out the exact syntax you need to use an unfamiliar built-in function or troubleshoot a cryptic error message.

  3. Identify your first project. Like I mentioned before, computers are really good at doing repetitive tasks over and over again. They're also excellent at math. If you have a problem that involves either of those things (or likely a combination of both) it's probably a good first programming project.

  4. Choose the right programming language for the task. My professor learned how to program in VBA because he liked using Excel, which includes an integrated VBA editor and compiler. In grad school, I wrote a lot of scripts in MATLAB to process my research data (and we were given a student license as part of a class). Eventually, I taught myself Python because I could do all the same data processing (and more) in Python and it’s free! Many engineering software tools, SolidWorks and FEMAP are good examples, have APIs (Application Programming Interfaces) that allow you to customize them to your needs.

    Some tools use their own language or a variant of a popular programming language, but don’t worry, the internet will have the information you need to get started. It's always worth the time to poke around and understand the additional flexibility a tool provides its users.

Enhance Productivity, Collaboration, and Value with Computer Programming

My ability to write short computer programs to automate aspects of my workflow undoubtedly makes me a more productive engineer and a more valuable asset to my team. It also makes my collaboration with our software engineers more productive because I have a better understanding of their perspective, their tools, and their constraints. 

In short, it adds breadth to my skill set and augments my ability to execute my mechanical engineering tasks. Cross-training outside of my home discipline helps create a systems-level perspective that allows me to take a good technical solution out of its context and recognize its potential to provide value in new disciplines and businesses.

At First Mode, we're constantly on the lookout for ways to use a discipline's existing tools and expertise to solve problems in a whole new way. For me, that was recognizing that learning to program could automate my mechanical engineering tasks. 

Are there any skills you can cross-train to improve your company’s productivity?