Programming Civil Engineers
Next time you find yourself facing a repetitive task, or sifting through large amounts of data; think- can’t my computer just do this for me. And the answer is most probably yes.
The world of engineering has been becoming progressively more digital; with monstrosities such as ProjectWise entering the common vernacular (verb. to make someone else’s document control your problem). As such, being able to make a computer sit-up and dance (metaphorically, of course) is likely to make your life a much brighter place. So this week, I thought it would fun to share some tips of direction for engineers who find themselves tempted by the dark-side of automation…
Get Yourself A Good Editor
It is a depressing fact that a lot of the programming Engineers are exposed to are scripting languages; and as such they tend to discover that Notepad will open most script files and then stop. This is akin to discovering the ‘+’ button on your calculator, and leaving it at that. Your programming life will be substantially improved if you pick-up an editor that was written after 1985. To help you along, here are three free (and typically portable*) editors I’d personally recommend:
- NotePad++ Probably the easiest, it’s like NotePad, but with all the pretty colours (syntax highlighting) that make life in another language so much easier.
- Sublime Text This is my editor of choice, it’s a little more advanced than NotePad++, and thus a bit more complicated. But with a plug-in system you could drown in, and the ability to write in multiple places at once; I’d say it’s worth the learning curve.
- Visual Studio Express If you find yourself getting hardcore at programming, Microsoft give away a cut-down version of their professional programming software. It should be noted that Visual Studio is pretty much the only Microsoft package I have anything nice to say about…
*Portable Apps are those that anyone (even without administrative rights) can install on a computer. I definitely forbid you from looking at PortableApps.com where you won’t find a range of applications that fill every one of those needs your IT Administrator has been needlessly blocking for years…
Learn By Doing
Just as Blain in Predator ain’t got time to bleed; I expect that most engineers ain’t got time to learn. This is where the wonder of recording comes in. A lot of software that provides automation allows users to ‘record’ what they’ve done straight into code. I see this a lot with Excel; and it is a good place to start. A word of warning, however, reading recorded code is pretty much the best way to learn some incredibly bad habits, and plays all too much into the “it works, it must be right” attitude that will quickly find you sitting in a high tower of code without any abstract foundations.
Choosing A Language
There are tonnes of websites where programmers freely exchange tips, and answer questions.
I expect the language that most engineers who have programmed used is VBA (this is the Visual Basic that comes packaged with the likes of Excel). VBA is very much like an old dog, it hasn’t learnt any new tricks in quite some time. This means that moving from VBA to another language can be a bit intimidating; especially when people start throwing words around like Generics and Polymorphism.
Ultimately, for engineers, I expect most times you’ll be tempted to program you’ll be trying to automate from inside of something (e.g. Excel Macros), and then you’ll be tied in to using a specific language; although breaking out isn’t hard to do. If you find yourself doing something from outside a framework, however, I’d recommend pointing yourself towards Python (or C#, if you’re aiming for higher things).
Some Of The Magic Words
Just as Civil Engineering has it’s Larssen piles, arc welding and PPPs; programming has its own collection of keywords and made-up acronyms. Whilst I’m not proposing to list them all, it might be worth giving a nod to those that are most likely to be that unknown search term that sorts out that frustrating problem…
- COM is how most programs are able to talk to each other, and despite being invented for Windows 95 it still exists today. If you want to start automating a program from the outside, start searching for COM (although it’s more famous these days as a website suffix…)
- API or Application Programming Interface is the technical term for all the special functions programmers wrote with the sole purpose of manipulating one program from another. Most major software has something like this (even Twitter).
- Scripting is an odd one- the simplest difference between a script and a program is that a script is read by a program, and that’s what makes it do something (there are more technical differences). The antithesis of scripted is ‘compiled‘. Crucially scripted programs typically throw errors mid-way through running, whilst compiled programs warn you about them before you start (a bit of a simplification there…).
Learn Where To Get Help
Compared to Programmers, Civil Engineers are as introverted as that guy who stands outside the kitchen at parties. There are tonnes of websites where programmers freely exchange tips, and answer questions. My personal favourite is StackOverflow, which has yet to let me down; and has a massive, friendly, community that includes a lot of top industry programmers.
Another thing that programmers do is share. All you need do is search the vaults of GitHub to find someone who has at least tried to do what you’ve done, and probably done it better. Whilst I’m not claiming to be the best programmer in the world, my GitHub alone has a good few examples of things you can do with LUSAS, Excel, Word and Outlook that’ll leave them doing all your work while you go and make coffee.
So next time you find yourself facing a repetitive task, or sifting through large amounts of data; think- can’t my computer just do this for me. And the answer is most probably yes.
In fact, I’ll got a bit further this week; if you’re interested in automating something, either drop me a comment here, or send me a message on twitter, or Facebook, or whatever– and I’ll happily give you some pointers on how to solve your problem…