Why Everyone Should Learn to Program
by Dan Haggard
Today we will be reviewing a programming language. Yes! A programming language – Python to be precise. But as per usual here on RID – we won’t be looking at things from the normal perspective. If you head on over to the various places where hackers hang out on the internet, the sort of discussions you’ll find run something like the following: What is the programming language at issue? Weigh its pros and cons versus other languages. How is it typed? Is it object orientated? Is it functional? What in fact are the advantages of these features… etc… What is much more uncommon is a discussion of the question – why should anyone learn to program? And that’s the question I’m going to answer today. In short, you should learn to program because it’s easy, it’s fun, it will increase your skill set, and… it will fundamentally change your perspective on the world. It will blow your mind. You’ll learn why it is that the hacker sensibility is becoming such a powerful cultural force. What follows is the proof to my hyperbole – so read on…
About a year ago I told a friend of mine that I had started to learn the Python programming language. He asked with a raised eyebrow why it was I wanted to do this at age 34.
“Take it from me as someone in the industry,’ he said disparingly. ‘We only hire guys who know their stuff. Python is fine, but you’ll need to know C, C++ among other things. A couple of years of work and you’ll still only be a novice. If you’re looking to change careers this aint the way.’
His advice is almost certainly correct from the point of view of trying to get a job as a programmer. It highlights nicely the perception most people have of programming. It’s a career path. It’s something you do to earn a living. It’s something you specialise in – or you don’t do it.
This perception is so widespread and ingrained in our culture that it defines just about all our institutionalised work place structures. A company will either buy its software, or if it’s in need of specialised software to automate particular processes, then it will high a specialist to create that software. None of the other employees will be expected to know how to program. It is the cultural default that an employee is expected to passively receive the interfaces with which she must interact on a day to day basis.
But this is our cultural reality not just in our work lives, but in all facets of our lives. We passively receive ALL the various interfaces that we deploy to manipulate our environment: the stove top you use to cook your food, the knife you use to cut your meat, the piano on which you play your music, the steering wheel you use to drive your car.
Just think about that for a moment and let it sink in. EVERY interface you employ on a day to day basis is likely created by someone else. And since our own creativity is necessarily constrained by the various interfaces we employ then an absolutely crucial dimension of creativity is denied to us.
This fact of our existence enslaves us to reality in a way that most people are completely unaware of until they are shown how they can break free. To show you this, I’ll describe a concrete example of what I mean.
I currently work as an administrator at the University of Sydney. I was asked by one of our academics to provide a monthly report of all the publications by all the academics and post graduate students in the school. In response to this request I surveyed my options for obtaining this data. In a school with around 250 staff and students this was no small task.
- I could email all the staff and ask them to email me the data every month and compile it manually.
- Find some software that would allow me to do this relatively easily.
- Program a solution myself that is perfectly tailored to the process.
Option 1 was a non-starter. It would result in my insanity as well as the wrath of every academic in the school at having to constantly email me their publications for the month. So I proceeded quickly to option 2. Things here weren’t much better. A programmer in another faculty had in fact built some software which sucks down publication data from the PubMed database (where most of my academics are published). But the problem was that it wouldn’t provide data on a monthly basis. Why – you might ask – does it fail to provide something so simple? Because it was built to serve a very specific purpose, namely, to aid in the reporting of publication information to the Australian government – a task that needs only to be completed yearly. So the software only ensures that the previous year’s data is scraped.
The academic that requested the report suggested an online tool that emails you notifications based on various search parameters. Besides having to manually input all the search data – I’d still have to manually collate the information into a readable excel report – with my emails getting all clogged up.
So option three. Turns out that PubMed has a very easy to use API (application programming interface) which allows one to query their database with your own software – receiving data in a nicely structured way that remains consistent (so it doesn’t break your program). Within a couple of hours I have working prototype that queries PubMed for all the publications (along with their associated data, like journal information, abstracts etc), exports it into an excel spreadsheet (using the awesome library openpyxl) that is emailed to my desired email address. A cron job on one of my servers ensures the report will be generated on a monthly basis and sent to the academic who requested it. The ENTIRE process is therefore automated – and I won’t have to think about it ever again.
I saved myself a mountain of work, that I otherwise would have had to trudge through every month. I freed myself to do other more interesting things in my work. The interfaces with which I have been provided with by my work environment were not able to free me in this way. I needed to be able to code to do it.
Approaching my work in this way subverts an established paradigm of modern work - that we need to rely on others to free us from the tedious processes that constrain us. But we don’t. It’s this possibility that should be blowing your mind right now – if programming is something new to you. If you use a computer in your day to day work – it’s very likely that your processes have developed to a point where they could benefit from some degree of automation. And the only person really qualified to provide that automation ultimately will be you and YOU alone – because you may well be the only person who knows the process.
Blocking you from pursuing this course of action is your belief that learning to code is a massive investment of time that defeats the reward on investment. This may have been true once. When there were only lower level languages to use, there was a great deal of complex manual work that higher level languages have now automated. What’s more, due to the wonders of open source – there is a practical infinity of libraries that further automate much of the grind work in programming. Such are the virtues of Python and many other scripting languages. In learning to program, your access to the varying kinds of interfaces out there increases beyond imagination, as well as giving you the power to craft your own.
In my own case, within three months of learning python part time I had enough knowledge to perform the sorts of tasks I described above. I’m not an expert in the language. I’m not an expert in programming – far from it. But I don’t need to be for it to make a material difference in the quality of my existence. I will likely never get a job as a programmer. But that was never the aim. It was never about being able to build interfaces for other people in a contractual fashion (i’ll be happy to do it in an open source context, however) – it was about building interfaces for ME.
Given the relative ease in learning the basics of programming in scripting languages like Python, the time has come to challenge the assumption that programming is a specialisation. If you need an analogy: is learning to read and write in a spoken language like English – a specialisation? No, it’s a fundamental tool needed to navigate your contemporary existence. It’s easy enough to learn that you devote some of your early years to the task – and then it stays with you for life. You could go on to specialise in language use. Maybe you’ll go on to become a writer. But you don’t need to specialise for your language skills to provide you with an incredible level of life-improvement. Well – so to with programming.
What’s more – I now feel cured of an affliction I never realised I had. If I had to name this affliction, I’d call it – defaultism. Always did I just default to the way of things as it was handed to me. Now I look at every aspect of my life with a hacker’s eye. How can I free myself of this task? – is the question now at the forefront of my mind at all times. There is no need to throw out every interface with which we are presented. If it fits our needs and desires then fine. But how often do you subvert your own desires and needs because of the constraints imposed by the limitations of the interfaces with which you have been bequeathed?
I look at the world around me and feel almost disgusted by the entrenched defaultism that I see everywhere. For instance, when the internet came along there was a sense of liberation from the passivity of watching television. We learnt to talk back. We learnt to create our own blogs and express ourselves as opposed to merely imbibing the thoughts of others in a mass daily dose of benign hypnosis. Clay Shirky informed us about the great cognitive surplus that would result from being so freed. And yet here we all are – facebook members all – allowing one site to define the structure of our social relationships. Yes we can comment. Yes we can poke. It’s more than television allowed. But it’s the whole world still watching one tube, one interface – just as it was before. As always we accept the tools on offer without ever questioning whether or not our desires and needs extend beyond it.
Many of you can’t imagine this because you’ve never had the experience of having your desires open out in the sort of way I mean. The way the interfaces with which you interact constrain your awareness of those desires, because as far as you are concened – they exist outside the realm of imaginability.
‘OMG That’s AWESOME – I want to learn to code!”
And she felt this way because she had been given a glimpse of the way possibilities expand when freed from the constraints of the default interface. Her immediate reaction was: “I WANT THIS”. Hence her desires opened outward in a way that was scarcely conceivable to her before. In this way does learning to code literally change your life. It frees you from the defaultism you likely never even knew you had.
Imagine applying this perspective to the interfaces like Facebook which currently define many of your social relationships. Imagine having the desires to reshape these experiences in a variety of new dimensions. Imagine meeting people with similar desires. Imagine the creativity you could bring to bear in the development and progression of those relationships. The default processes of ‘friendship’ would become positively depressing to you. You’d see your former life as a barren, grey void of routine and habituation.
Learning to code is about the best antidote to the defaultism of our modern age I can imagine. It’s time it became a fundamental pillar of our cultural lives. For most of those in the hacker community – such sentiments I think will be old hat. But the hacker community remains relatively insular. It needs to learn to engage more outwardly. The hacker sensibility needs to spread beyond its elite origins and mainstream. Many won’t like that idea – because it will muddy the ease of self-identification that hackers currently enjoy. But the value to the world at large will be immense – so it needs to happen.
Hopefully it will.