I first tried to learn to code in 1999 when I was 12, grabbed myself a copy of SAMS Teach Yourself C++ in 21 days and figured I’d be cranking out the world’s best games on day 22. Well, day 4 arrived and I had thoroughly had enough - I’d made a calculator that could do single operations from a terminal input but it had been a boring, arduous process so I called it quits as I couldn’t see how this was going to help me make the next Need for Speed! Decent will power was clearly not one of my qualities back then!
Anyway, whizz on 7 years and I found myself sat in the computer lab in stage 1 of my electronics degree with a Bearded Russian Man lecturing us on the importance of being able to program as an electrical engineer … yeah right we all thought. Well, I managed to scrape through that module and the end result was some irrelevant scripts that could work out the resistance of a resistor network that you would never build in real life and a software UART (looking back this is actually kind of useful for embedded work - at the time it was about as interesting as watching grass grow).
So, strike 2 for programming.
Strike three came in stage 3 of the same degree course when I had to program a micro controller to drive a stripped down remote control car round a track without any input from me - well, several hours of group programming by the teams later we all had oddly similar buggies driving round the track!
No more, I decided!
I wanted to work in semiconductors (I’ve always found it the easiest bit of electronics to work on - something about holes, electrons and drift/diffusion currents just clicks with me) and programming was not going to factor into my career.
Well, the best way to work in semiconductors back in 2008 for a recent graduate was to do a PhD as no one was hiring - three years locked away in a lab to avoid the recession and I’d land a nice job at the end designing transistors to work in jet engines and volcanoes - yeah, my PhD was pretty fun!
Needless to say this plan is not what happened.
My PhD is complete (2 years, 11 month and not a day to soon), I don’t work in semiconductors and I write a few hundred lines of code a week for my job and my side projects! Surprised? Looking at my track record with programming I am as well to be honest.
So what changed?
I needed to solve a problem, that’s what. I needed to control some lab equipment to run some boring, repetitive device tests and there was no way I was going to sit and do it manually - as every PhD student worth their bursary knows, if your experiments can’t run themselves whilst your in the coffee room then you’re doing it wrong.
Now, C++ was clearly not a good option for me to start with, particularly as I actually had to get something working before my PhD finished. So, I fired up a copy of LabVIEW (which is what most of science seems to run on to one degree or another) and started dropping additions, subtractions and long interconnecting lines to get something working.
I have no idea what it was, maybe because it was graphical, or because it was so easy to make a graph or just that I genuinely could sit in the coffee room whilst my experiments ran themselves, but something clicked. I suddenly “got” programming and soon I was writing LabVIEW code to parse massive data sets of JFET characterisations from room temperature to 300 degrees C just because I couldn’t face the two hours of manual work to do it by hand - I’d moved far beyond my original intention of just controlling lab equipment, programming was starting to become part of my day to day work flow.
Soon I realised that I wasn’t using the best tool for the job in some cases and I decided to learn a proper language - C. Looking back I realise now that a higher level language would probably been a better way to go for parsing data sets but back then I wasn’t to know that. Although, there is a certain satisfaction in writing your own explode function and working out how to store all the new bits of data that you suddenly have to deal with - malloc’s can get a bit out of hand as I learnt to my detriment on many an occasion.
Anyway, that was 6 months in to my PhD and 3 years later I am fairly confident that I can get stuff working in a range of languages, not perfectly, but working. I don’t have a computer science background so I’m sure there are some basics that I’m missing but here is what I have learnt to some degree or another and how I have utilised them.
- LabVIEW: Controlling lab kit and making graphs and parsing large data sets before I knew better.
- C: embedded electronics, microcontrollers, low level stuff and parsing large data sets before I knew better
- Assembly: for embedded stuff, not fun but it does make you appreciate how a status register works and what and arithmetic logic unit is that is still relevant in higher level languages
- Objective-C: wrote an iPhone app for a business I ran that produced bespoke iPad and iPhone cases
- C++: for the MBED microcontroller - because that’s what their API is in and we used one to develop the Radfan test rig (I still hate this language though)
- Processing: Data visualisation for representing the data produced by the Radfan test rig
- PHP: Because the web is built on it and I found it before I found out about Ruby or Python
- Javascript: I realised HTML and CSS is boring without it and needed it to make the website designer for the iPad and iPhone case business
Looking back at my earlier attempts to learn to program it is quite hard to believe that years of saying “I can’t program and I hate it” (yeah, mature right?) that I have now build a number of things in a range of languages and am now moving up to using Codeigniter for my latest project OneQstn.
What changed?
Well, in the first three attempts at programming I was either doing for no real reason so didn’t push on when it got harder or, because I was being forced to do it for uni work and I couldn’t see the point. Once I realised that programming, albeit with LabVIEW, could save me time and solve problems, it clicked with me much more. As to why I have spent many hundreds of hours since then learning new languages and making new things, I think it boils down to the fact that being a hardware guy who can code, and being a startup founder who can code, just makes more things possible and I’ve realise that it is a pretty vital skill to have.
If anyone else has as similar story I’d love to hear it, or any story of haw you got into programming really.