Arduino or: How I learned to stop worrying and fell in love with coding again
As programmers today, the code we write sits atop an enormous stack of abstractions. There are so many excellent frameworks, libraries and how-tos out there that it sometimes feels as though there's almost nothing that we have to work out for ourselves, and that the focus now is on execution rather than the intellectual challenge of working out how to make something work. For non-programmers this is all good, but for programmers it's tinged with a little sadness.
An Arduino Uno board wired up to display an animated pattern on an LED array.
Today, the process of writing code is that of creating and chaining abstractions together. The apparently simple act of writing, proof reading and publishing this blog post probably involves making use of several thousand of them.
When I'm asked what I like best about being a programmer, I talk about how satisfying it is to see someone else using and enjoying the software I help to build. Today, it's human factors rather than technical ones that make achieving this difficult because, although the technical underpinnings exist to make great software, it still takes talent and care to shape these together into things that users like using, even if there are no complicating factors like politics or hobby-horses. But, this leaves us with an intellectual hole to fill.
Here's our own Paul Battley on how his language of choice – Ruby – is losing some of its lustre:
There can be interesting problems on the web, but much – maybe most – back end website development consists of little more than gluing together third-party libraries into database-backed sites with schemata of varying complexity. The bulk of the work then becomes debugging the interaction between these (frequently somewhat sketchy) components, building out the convoluted business rules, and translating what has been promised into what can be made within the constraints of time, budget, sanity, politics, and the detritus left by previous design decisions – decisions which may even have been sensible at the time. These external pressures sometimes mean that things that could feasibly be simple end up baroquely complicated, but that doesn’t necessarily make them intellectually stimulating.
One thing you'll notice when you work with talented developers is that they will nearly always jump at the chance to work on a new project. Why? One important reason is that they deliberately seek out intellectual challenges. This is why we became programmers in the first place: we enjoy untangling complex problems and bringing our own sense of order to them.
I think that this is one of the reasons that good programmers are so likely to be early adopters of new technologies and services. Sure, they want to figure out what the possibilities are, but I believe that really we adopt unstable technologies because we know that we're more likely to have to figure things out for ourselves.
I was puzzled for a long time about why people found Arduino so interesting. At first glance it's a very simplistic, intentionally limited platform that allows you to prototype simple electronic products and control them with fairly basic code. Arduino has very limited RAM (just 4KB for data, which is 0.0001% of the RAM in the computer I'm using to write this post), poor language support and gives hardly any protection against making stupid mistakes. In the world of astonishing feats of electronics like the iPad or the Kinect, what could possibly be interesting about turning LEDs on and off?
A couple of weekends ago six of us attended an Arduino workshop at the London Hackpace run by Mike of Earthshine Electronics. Putting my puzzlement about why it might be interesting to one side, I went along too. It turned out to be a highly enjoyable day in which we worked through an increasingly complicated set of examples, learning as we went some of the basic principles of how to wire things up and how to send output and receive input.
Something that didn't work.
Initially, I thought my enjoyment stemmed from the similarity to the tools and simplicity of the platform that I used when I learned to program (the late 1980s with a C compiler and no Google to ask for help). But now I realise that it was not nostalgia for the tools I used, but rather for the mental challenges I faced back then: the challenge to understand something and to bend it to my will.
For me, learning to program was a process of barely perceptible enlightenment in a storm of misunderstanding and error. I think this is why starting to hack with the Arduino felt like a homecoming to a world of comfortable befuddlement. Like many programmers, I yearn to be presented with problems that are just beyond my intellectual grasp.
Crucially, with Arduino there are radically fewer abstractions between you as programmer and the electrical circuitry your code manipulates. While this makes it significantly more difficult to create useful things, it takes you much closer to the reality of the physical world, and gives you the chance to recapture that thrill of making something real, no matter how simple it is.
I'm not sure that playing with Arduino will make me a better programmer, or even a better creative technologist, but it's definitely provided me with a platform to enjoy myself on again. Eventually, it won't seem challenging and I'll have to find something else to figure out, but for now I have my technical playpen and I'm happy.