Matt Segal Dev

Nand to Tetris is a great course

Fri 17 April 2020, by Matthew Segal
Category: Programming

Everyone who learns programming at some point stops and asks - how does this actually work? You might know how to write and run code, but what's actually happening inside the computer? It can seem unfathomable.

Some people don't care about what's happening under the hood. Their code works, it gets the job done, why would you bother drilling into the details? I'm like that sometimes, and you can get a long way coding without knowing the fundamentals of computing, but there is a certain clarity and confidence that you can only get from knowing that you could build a computer from scratch... if you had the time.

You too can build a computer

I'm glad to say that you may well have the time to build a computer from scratch, since that's what you do in the online course Nand to Tetris (website, Coursera). The course takes you through 12 projects, about 1 week each, where you incrementally build:

All of this is done on your computer using tools provided by the course. Once you've done these projects you will understand the building blocks of a computer from the RAM and CPU, to assembly up to the compiler that executes your programming language of choice. It's a powerful course that will unlock a whole new perspective on computer programming for you. I believe that bang-for-buck it's probably the best online course for someone who is a self-taught programmer. It's practical, fun and mostly oriented around building things.

I found that the course took a few weeks to really get into gear. The intial content on boolean logic and arithmetic can be a little dry, but if you can get through that, the course becomes more interesting and rewarding. It's a pretty cool feeling to run a program that is executed by a system that you wrote, from the compiler to the VM to the assembly code to the CPU.

What you need

The course description is a little over-optimistic in my opinion:

This is a self-contained course: all the knowledge necessary to succeed in the course and build the computer system will be given as part of the learning experience.

It's mostly self-contained, but really you either need to be an intermediate programmer, or very gung-ho. I'm not trying to talk you out of the course if you're new to coding, just know it's going to be challenging and you might get stuck from time-to-time. I believe that anyone can get through it if they are determined.

The whole course consists of projects and there's automated testing of your work. If you're not in the habit of doing it already, I strongly recommend learning how to write unit tests in your programming language of choice. It's 1000x faster to write your own tests and run them on your computer than to upload your code to Coursera and let them verify whether your code works. You will write bugs, and you want to minimise the feedback loop required to find them.

If you have lots of free time and you want to line up a 1-2 punch of theory and practice, you could also watch Harry Porter's Theory of Computation videos, which teach you the mathsy theoretical underpinnings of computer science.

Do it! (if you can)

Not everyone has the spare time to commit to 12 weeks of programming projects, but if you do, I encourage you to give this course a try. Knowing how a computer works from chip-to-compiler is a nugget of knowledge that will be useful for your whole life. I can't say the same for learning the latest JavaScript toolchain. Give it a try!

If you have any feedback or questions email me at [email protected]