The First Thing To Know About Programming

If I were put in charge of teaching you how to program, the very first thing we’d cover is a simple principle: Code is for humans.

Code is for humans, far more than for machines. Sure, the machine executes the code. The machine is a wonderful thing. But the human telling the machine what to do is even more wonderful. The capacity that code gives us to collaboratively create elaborate, elegant, executable structured meaning is more wonderful still.

When programmers don’t remember that code is for humans, we write code that’s hard for a human to read. And of course, code that’s hard for a human to read tends to be hard for a human to change. We make our colleagues’ jobs more difficult. We make our own jobs more difficult.

A lot follows from this little principle. It’s not easy. Naming things well is hard. Structuring things sensibly is hard. There’s often not a clear best answer. But there is often a better answer than your first pass. Even a little bit of consideration for the humans goes a long way.

(But you should give a lot.)