When Jamie asked me if I’d like to contribute an article about beginning to learn coding, I’ll confess that I was slightly intimidated. It’s a big subject, and one that I’m not entirely certain I can do justice to in one posting, at least not without boring you all to death. It seemed to me that there were two big geektastic questions here; firstly, how do I start coding or programming from scratch, and two, how do I go about putting that into a way of making a living.
There’s no way to answer those two questions in one easily-digestible sitting, so I’ll be splitting my original idea into two postings, one about how to get started, and the next one about how you might go about pursuing careers.
I’ll start with a couple of disclaimers: firstly, you can trust me, but you don’t have to believe me. I’ll be writing about the road I took, and your mileage may vary. Do your own research, talk to other people. I’m claiming experience, not authority. Your socioeconomic, familial and geographic concerns will make your experience different to mine. Did you notice the thing I left out there? The one thing I will not be discussing in these posts is ethnicity. Not that it’s irrelevant – it’s hugely relevant – but it’s a topic so huge that I can’t even begin to address it by myself. So I won’t. At least not in these posts. Secondly – I don’t have a dog in this fight, I don’t want to be a celebrity on teh intarwebs, and I don’t want a part of your stupid wars, whoever you are. Linux vs. Windows vs. WTF. Ruby vs. Python. My gang yay, your gang boo. I just don’t care. Take your hatred somewhere else and let grown-ups have a sensible discussion. OK? Good.
Let’s get started.
When a smart, articulate lady like Jamie asks you for pointers on getting started in coding, you have to take pause. Glibness like “google it” or “ buy a book” ain’t good enough, and her serious question demands a serious reply. Sadly, this reply can only come in the form of a question, which is, “what kind of coding are you interested in?” I broke the question down in to these possible replies:
i. I want to have fun with programming.
ii. I want to run my own web application and make it dance.
iii. I want to get into web design and graphics.
iv. I want to get hardcore with math and A.I. and build a race of evil robots to rule the universe.
v. Aren’t you going to talk about Java?
vi. Aren’t you going to talk about databases?
In each case, the answer will be a little different. Let’s consider them one-by one.
i. 1. I want to have fun with programming.
Back in the day, meaning any time before about 1977, computers were fearfully expensive things that only big corporations, major universities or the Air Force could afford. That was a fact of life until about 1980, when a bunch of enterprise-minded mid-size companies began selling small machines that were within the budget of – let’s say – the child of a reasonably well-off family could ask for Christmas. This was a huge turning point, as it put the ability to own a computer and write computer programs into the hands of hundreds of thousands of small children. That’s the revolution I’m coming from, and that’s what I think of when I think of programming for fun. Just the sheer, unadulterated joy of writing a program from your own sweat and tears (and occasionally, blood) and watching it run. (your program, not your blood.)
In the days of the Sinclair ZX-81, Acorn Electron or VIC-20, this meant BASIC. Nowadays, it pretty much means Python. For those who care, I’m a Ruby person myself, both from familiarity and workplace demands, but I’ll fully admit that Python is a great, great language. You can learn the basics in an hour, even if you’ve never programmed before, it can do anything you want, and there is a massive and supportive community out there to help you. Equally important, it’s the language of choice of the Raspberry Pi community, a thing which plans to give to geeks of all ages the chances and fun that my UKP15 ZX-81 gave to me when I was four years old. Of which more later…
The big thing to take away from here is that programming is fun. Maybe you’re quite young, and you’re interested in that stuff…..no reason why not. Maybe you are a little older, and never even thought about it before. It’s fun in the same way that hobby electronics or building model aeroplanes, or sewing or community theatre is fun, which means, “at least as frustrating as it is rewarding”. There are Python programming books in preparation for age 7+ (yes, you read that right.), and it’s a language and environment which will serve you very well all the way from having fun at home all the way to Graduate School.
FOOTNOTE. Not to disrespect the old classics. C is still very much worth learning, especially if you fancy your chances of being a games programmer and you really need to know how to maximize every single bit of kit. C is not fun. It’s not easy, and it’s not even very rewarding. It’s more like a drill instructor that will never reward your efforts, but will mercilessly punish your tiniest mistakes.
Fortunately, it is very well-served by a tiny little book – “The C Programming Language” by Brian Kernighan and Dennis Ritchie (universally known as ‘K&R’) , which has been in continuous print since about 1978. We will deal with this book more in the next article, because it has become a legendary example of how to write on technical subjects in an understandable way.
2. I want to run my own web application and make it dance.
A good place to start here is PHP. Now, before the tribalists start sharpening their tomahawks and sizing up my scalp, I want to repeat myself: PHP is a great place to START. Not to end up. I’ve forgotten more about the design problems and syntax limitations of PHP than you ever knew, so bacdafucup. I’m writing an introductory article for folks who want to get started in programming, not for the folks who eat Capistrano, nginx and Unicorn for breakfast and still have time to benchmark against Passenger.
The big deal about PHP is not that it’s a particularly great or elegant language, but that it’s absolutely everywhere. It runs on almost every platform, and when you want your web app out in the world, you can get nice, friendly hosting for USK30 per year. It’s a baseline, start-up skill for anyone who wants to get their first web application on line, and although you may move on from it, it’s a fun way to start. Plus, if you know PHP, you can start hacking on Wordpress.
Wordpress in itself is a big deal, because it’s such a mess. It’s a community project with a billion billion lines of code, some of which reads like it was written by spiders on LSD. It’s also an immensely capable platform on which to launch your web log or web site. Finally, it’s a great trial-by-fire for a situation that you are ABSOLUTELY going to find yourself in if you decide to pursue a career in programming: you are going to be dealing with a lot of horrible old code written in horrible old languages, and learning to keep your head whilst exploring the archaeological ruins of Wordpress will be great practice.
There are about ten trillion languages and environments out there. There are great programmers who have built careers and businesses on PHP, which is why I am not happy to hear hatred about it. Sure, it’s not the new hotness, but it’s there, it’s an inexpensive way to get your app off the ground, and most of all, it has a huge support network in dozens of languages.
3. I want to get started in web design.
No options here. The skills you need are HTML, CSS and Javascript. Don't bother about all those fancy-pants applications that tell you that you don’t need to learn to code, it’s all done for you. No. You need to learn it. There it is.
That’s the bad news. The good news is that HTML, CSS and Javascript are some of the most fun you can have with a halfway-decent PC and a bit of creative talent. If you are reading this article on the web, you already have the stuff. Put simply, HTML describes your semantics – the data, or stuff, you want up on screen. CSS describes how, where and when you want it shown. Our ancestors fought bitter and bloody wars about semantics and layout, which set father against son and brother against brother, but that’s all in the past now, and we can enjoy the zen-like tranquility of knowing that anything involved in actual “words you want to appear” is in your HTML, and “colours, fonts, sizes, positions” are all in your CSS. You can get started in both in under an hour, and it’s often a very rewarding experience for people who thought that getting down and dirty in the actual code of a web site was too much for them.
The other great thing is that it’s a mountain with no summit. You just carry on climbing, taking pleasure in each step, and watching as everything just carries on looking better and better, and working faster and faster and just straight out getting cooler. But as with every inspirational movie, there’s a dark sub-plot which we have to look at before we finish.
…and that’s the story of JavaScript, the unloved stepdaughter of programming. The poor thing that was foisted, unwanted onto Netscape in the early-90’s and forced to wear cast-offs and clean out the stables if she wanted any kitchen scraps. As you can guess, she got into shady, even criminal behavior – creating ugly pop-up boxes and horrid flashing buttons, until her reputation was so bad that by 1999 that respectable web sites were proudly announcing “No JavaScript”. A tragic end seemed to beckon– face-down in a squalid apartment, with hard-bitten old cop wiping a tear from his eye, saying “what can I do? There’s a million out there just like that”, then an umarked grave and a few old-times occasionally reminiscing, “yeah, I think I remember her”.
But it didn’t work out like that. Google, the smart new Don in town, realized that JavaScript’s years in the sordid underbelly of the Internet meant that she knew every street, every alley, every unlocked fire-escape in the city, with killer street-smarts that put most of his soldiers to shame. And with a strict diet and some exercise, plus a good suit and a decent haircut, she was a lady you could take anywhere and nobody’s eyes would be anywhere else.
And that’s the real, rags-to-world-domination story of JavaScript. You know the way that Google’s search box updates itself even as you’re typing? That’s JavaScript (admittedly, with a ton of industrial Python in the background). You know all those neat carousel photo windows on PInterest and a dozen others? That’s JavaScript too. Get close to her, because she’s been places you haven’t even had nightmares about, and she knows the score.
That’s the beginning of web programming. The end? Who knows…
4 I want to get hardcore with math and A.I. and build a race of evil robots to rule the universe.
Drop your street clothes in the basket by the door, take a shower, shave your head, put on this clean cotton robe and remember that you are here to listen and learn, not speak or argue, until you have proved yourself in the thirty-six chambers of pain. Welcome to the world of Functional Programming.
The most hardcore that maths, logic and AI programming gets is in the silent, fragrant temple of LisP and its descendents, Scheme and Prolog. Expect no slack, no sympathy and no support. This is the place to meet some of the harshest intellectual challenges in the world.
The definitive, undisputed text that you’ll need in this world is “Structure and Interpretation of Computer Programs” by Harold Abelson and Gerald Jay Sussman, most often referred to as “Ableson/Sussman”. This was the introductory course text in MIT and Yale throughout the late-‘80’s and ‘90’s, and that gives you an idea of just how hardcore it is. The purpose of this course was to weed out 90% of applicants. Chase them away, send them screaming into the distance. (if you need to know, NO. I was not anywhere close to applying for those courses.) If you can master it, as Harrison Ford says in ‘Apocalypse Now’, “you will never need to prove yourself in any other way”.
LisP and its fearsome brethren are unlike other programming languages. They are strictly functional, which is to say, they work like mathematics. The purpose of a functional programming language is not to tiptoe through procedures, but to evaluate expressions. Swallow ‘em down in one go. All of which will be old news to the nerds out there who snuffled up Integral Calculus and then asked for more, got Lambda Calculus for desert and still wanted to know if there was fruit or Ice Cream. Here comes the Ice Cream. And the only thing I have to say is “nuff respect”.
SO WHY THE HELL WOULD I PUT MYSELF THROUGH THIS CRAP?
Because programs written in LisP-based functional languages can do stuff that no other languages can do. They can re-write themselves. They can get a user input, check for a list of possible responses, and, if there is no good fit, they can suggest a new one. And then encode it back into their own DNA, so that when the question comes up again, they can use their own suggestion as a possible answer. They can analyse incredibly complex pieces of data like – let’s say protein structures – in a way that non-functional languages just can’t.
These are the origins of artificial intelligence, and even if you don’t plan to build an army of evil robots to take over the universe (and I know I do), they have applications in subjects like Immunobiology and Bioinformatics. Master this stuff, and you are well on your way to participating in a discovery that could lead to cures for viral diseases in humans. Even if biology isn’t your thing, there are other applications in astrophysics and allied subjects.
5. Aren’t you going to talk about Java?
Not today, no.
Today’s post was all about getting started, dipping your toe in the water, and hopefully getting people interested in the glorious, empowering, infuriating world of writing computer code. Java is a whole ‘nother thing. I’m not a booster and I’m not a hater, but I just don’t happen to think that it’s a good place to start. Of course, if we’re going to discuss Android programming, we have to bite into the Java hot-potato sometime, but that’s for later.
6. Aren’t you going to talk about databases?
Databases are a big deal in their own right, and deserve more than to be marginalized into a footnote on programming. Ideally, a more experienced database gal or guy would take this one up, but if I have to, I could write a little on this.
Richard is a creakingly ancient nerd who doesn't want to mess up stuff for the next generation with his cantankerous old-guy ways. He's old enough to remember watching Doctor Who on a B&W TV and listening to Slayer, Ice-T and Joy Division on LP, and programming in Assembler on a ZX-80. If you really, really want, you can write to him on: scarthumb AT lofilabo DOT com.