We’ve discussed before that by learning to code, a structural engineer stands to gain numerous benefits to their career progression, salary, and project portfolio for the CV. But what programming languages should a civil or structural engineer learn? In this article, we will cover the 4 most common coding languages applied in the structural engineering companies. Whilst there are dozens of other coding languages to choose from, we focus on these languages as they offer a lower bar to entry for civil and structural engineers and have been designed with civil engineering workflows in mind. We present them here in order of ascending difficulty to learn, so the first languages are easier to learn as a beginner.
1) Grasshopper
Background
Grasshopper is a visual programming language that can be easily adopted by civil and structural engineers. It originally was created by McNeel and Associates in 2007, and was quickly picked up by architects looking to push the envelope with their designs geometrically. You may have heard the term “parametric design” – Grasshopper was one of the original languages to make parametric design mainstream in architectural design. With its easy-to-adopt and debug interface, it lowered the bar to entry for design professionals to enter the realm of coding. Grasshopper is actually a plugin to a CAD and 3D-modelling software called Rhinoceros. So to use Grasshopper, some basic knowledge of Rhino goes a long way, however, you need not know any Rhino to learn Grasshopper (our founder learned Grasshopper first before Rhino!).
Pro’s
- Rhino can be attained on a trial license for free for 90 days which comes with Grasshopper. Equally, its also a one time fee subscription model – buy once and use forever!
- Geometrically inclined and visual feedback – which means you can see your design as it relates to the code
- Created for architects and engineers
- With the recent release of Rhino.Inside, a suit of tools inside Grasshopper, engineers can easily connect their Grasshopper workflows to the Revit models
Con’s
- Whilst Grasshopper has enough power for 80% of your workflows, there is a limit to what can be achieved efficiently in practice. At some point, you will want to turn your attention to text-based coding languages (see BHoM and C# below) for more advanced workflows
- Many tutorials you will find are focused on architectural examples. Engineers will find it hard to learn how to practically use Grasshopper from these architecturally focused examples. Don’t worry thought, TCE has you covered here!
Overall, Grasshopper makes a great first language for a civil or structural engineer looking to learn coding. Pound for pound, it gives any engineer trying to learn coding the best bang for their buck. It has a low bar to entry but is powerful enough to manage most of your workflows, including your Revit workflows. Make sure to check out our Grasshopper for Engineers courses to learn the basics of how to use Grasshopper as an engineer.
2) Dynamo
Background
Dynamo is a popular visual programming language for building and civil engineers. Dynamo was released by Autodesk around 2015 as a plugin to Revit. Due to its relationship to Revit, Dynamo became an obvious choice for many engineers’ workflows who are already using BIM, especially for BIM technicians. Given Dynamo is integrally connected to Revit, we recommended that you understand some of the fundamentals of Revit before learning Dynamo.
Pro’s
- Direct connection to Revit means that you can call the same commands you are used to in Revit. This is perfect for automating Revit-specific workflows that used to take days or weeks down to minutes or seconds.
- There is a whole universe of plugins that have been developed by more advanced users which you can get for free to enhance your workflows
- It is becoming more commonplace that companies demand Dynamo and Revit skills for their engineers due to its utility for processing information in a BIM model. Knowing a bit of Dynamo will assist your next job interview.
Con’s
- Dynamo is generally more buggy and less developed than its cousin Grasshopper (which had a 7 year head start!) which can lead to a steeper learning curve for beginners
- Being attached to Revit means that it can be a bit slow to work with for larger models
- Generally speaking, Dynamo is not the best language for processing of geometrical information. Its ‘background preview’ model is not nearly as intuitive or easy to use as Grasshopper’s red or green mode preview in Rhino.
Overall, Dynamo has a lot to offer a civil or structural engineer looking to learn coding, especially if they are already using Revit.
3) BHoM
Background
The Buildings and Habitat Object Model (BHoM) is an open-source repository of code full of objects and algorithms which are useful to building and infrastructure engineers. Originally developed by Buro Happold, the famous British engineering consultancy, it was open-sourced in December 2018 and available for anyone on Github since. The BHoM is developed using C# coding language predominantly, but is exposed to engineers in familiar user interfaces such as Excel, Grasshopper or Dynamo. There’s A LOT of useful and beneficial tools in the BHoM for many different types of civil and structural engineers. In this article, we’ll keep things high-level, but if you want more details on the BHoM, check out this video as a starting point.
Pro’s
- Made for engineers, by engineers
- Many useful adapters to engineering software such as ETABs, Robot Structural Analysis, SAP2000, and many others
- Many solutions provided to you for free that otherwise would take years of experience to create yourself
- Due to its solid technical foundation, the BHoM is by definition a scalable platform for your engineering workflows and can be used to tap extremely powerful algorithms
Con’s
- Due to the sheer volume of useful algorithms and objects the BHoM contains, it can take a while to get into and understand for a beginner
- Whilst it can be exposed in Excel, it is easiest to learn through Grasshopper or Dynamo, meaning you need to be familiar with those languages first
- A knowledge of computer science first principles becomes very important if one really wants to have a deep understanding of the BHoM
Overall, the BHoM is a bit more advanced as a language but offer’s immense power to a civil or structural engineer who takes the time to learn the BHoM’s key pillars of objects, adapters, and engines.
4) C#
Background
C# is a text-based programming language created by Microsoft in the early 2000’s.
Pro’s
- This is a “full-fledged” programming language to learn as compare to the other languages on this list. C# is the only language on this list which you will find used outside of the AEC community.
- The language is great for object oriented programming – which is great for building engineering workflows which depend heavily on objects found in buildings like columns, beams, ducts, and glass panels
- The BHoM codebase is written using C#, meaning if you know C#, you can truly own your workflows by debugging and editing the BHoM’s code to suit your needs
Con’s
- Difficult for beginners to learn as it is a more advanced language and has more rules and structure than other text-based coding languages such as Python, which are generally seen as easier to learn
- Tutorials you are likely to find are very technical (polymorphism, say what?) and lacking a link to structural engineering workflows. This means you may be able to learn the language, but learning how to use it in engineering workflows will be difficult
Regardless of which of these languages you choose to learn and in what order, remember that learning a computer language will be easier if you have some basic knowledge of computer science first-principles. Such first principles include knowledge of objects, algorithms, conditional statements, and loops, all of which will accelerate your learning curve for any programming language. Make sure to check out our Computer Science for Engineers courses to learn these first principles and accelerate you path towards being a computational engineer.