Learning the Binary Number System at 0b11100 Years Old
I’m a self-taught software developer. I can use Ruby to solve tough problems in a pinch, but ask me how computers actually work—end to end, no hand-waving allowed — and I come up blank.
For the first couple of years of my career as a software developer, I focused on figuring out how to be effective alongside colleagues who had much deeper experience and knowledge than I did. I learned whatever I needed to be a useful part of the team, whether that was Python, or Puppet, or Packer.
Being a new developer, particularly a self-taught new developer, feels a little like being out in the rain without shelter. To stay alive, you spend each day frantically building a shelter to try to keep the rain out. It’s made of bark and mud and old shoelaces — whatever bits and pieces you can scrape up and use to keep a little more of the rain off. Until one day, a year or two down the track, you realise that you’re mostly dry, mostly warm and comfortable, but the wind is blowing through the cracks that have formed between the mud, and leaves, and empty Twix wrappers. It’s time to build a house.
This is the phase that I’ve entered now. I know enough to be effective day-to-day and to get things done, but I want to start filling in fundamental gaps. Things like:
- How are computers architected?
- How does public key cryptography work?
- Why is SSL/TLS important, and how does it work?
- What are the most common security threats and exploits?
- How does TCP/IP work?
- What is needed to build an operating system?
- How can I write more efficient programs?
- What are some of the fundamental algorithms in Computer Science?
In a sense, I’m doing things backwards. I’m trying to give myself an education in Computer Science after my career in programming has already begun.
This is partly for practical reasons, and partly to satisfy my own curiosity. As I move further along in my career these knowledge gaps have started to sting me more often, as the most difficult problems tend to bleed out of high-level land (where I feel most comfortable), and into the nitty gritty details of how things actually work. I’m lucky to have super-smart colleagues, both at ThoughtWorks and at my current client, who understand that I don’t have a CS background and will take the time to explain certain concepts to me. But each time that happens we have to move a little slower, and I’m aware of that.
Most importantly, I want to learn to satisfy my own curiosity. I love computers and really want to understand everything I can about how they work.
Lately I’ve been reading The Elements of Computing Systems, a.k.a. Nand to Tetris, which takes you through the process of building a computer from first principles using HDL (Hardware Definition Language), an abstraction that allows you to design computer architecture without needing access to vast stores of Silicon and a factory in Chengdu. It’s a wonderful book, but assumes the reader is an undergraduate CS student with the prerequisite knowledge that comes along with that. By contrast, I studied Journalism at university and dropped maths at the earliest opportunity during high-school, assuming I’d never need it for my future career as a writer. (My learning from that experience is: a high-school education shouldn’t be about doubling-down on a chosen path, but instead, about enabling you to go down as many paths as possible — even paths you don’t consider possible at the time. But try telling that to an 18 year old…)
Early on in the book, I got to a section about binary numbers. I was excited. I knew the very basics about binary, that it involves 1s and 0s, and that you can use these two digits to represent anything in computing. But I was looking forward to finally learning how binary numbers work, and how they can be used to represent the decimal numbers we are familiar with.
Sad trombone. This explanation wasn’t accessible to me. I was missing too much of the assumed mathematical knowledge, and couldn’t follow it.
I’m not annoyed at The Elements of Computing Systems. It wasn’t written with someone like me in mind — and, after all, my background is a little odd. But this happens to me regularly when trying to teach myself Computer Science concepts. I wonder if other self-taught developers share the same experience.
I ended up swallowing my pride and learning about binary numbers from an article written for children. This article contains the simplest and best explanation I have ever found on the topic. In fact, I’ve noticed this more than once: that educational resources meant for kids are often the best way to learn things as an adult.
When teaching kids, you can’t rely on assumed knowledge to take shortcuts. You need to explain concepts from first principles, in a way that anyone can understand, regardless of their background. It’s surprising how often concepts that seem very complicated when taught to adults are revealed as beautifully simple when taught to children.
I suspect the reason there are fewer learning resources aimed at adults that teach from first principles is that there is additional overhead to producing it. Instead of writing five paragraphs to teach binary numbers from first principles, the author can write a one-line mathematical equation that explains the concept succinctly. The author might fail to teach the 10% of readers who don’t have the requisite mathematical knowledge, but will bring along quickly the other 90% that do have it, and avoid rehashing concepts they’re already familiar with.
I understand this, and I think it’d be silly for everything to be explained from first principles all the time. But I would like to see more adult learning resources dedicated to the 10% who are the odd ones — the Urban Planner who played Shenzen I/O and wants to understand more about how computers work, the front-end developer who cut their teeth with the help of YouTube tutorials and wants to understand more about performance optimisation, the tech journalist who wants to understand what Artifical Intelligence actually looks like in 2016, without all the hand-waving.
As it is in the open-source community: don’t complain, contribute. I want to explore ways to teach the things I learn about Computer Science from first principles, in ways that anyone can understand.
After all, the discipline of Computer Science is founded on the idea that you can build complex and beautiful systems from the simplest, tiniest, fundamental bits.