Yes, Do Learn To Code!

Posted by | Development | 6 Replies.

My usual pre-work routine is to walk the dog (working at home, this is my counterpart to a commute), pour my first cup of coffee, and then curl up for a little while with Google Reader. I don’t know if it’s because I’ve selected feeds that are too closely aligned with my values and personal agenda, but it’s really rare that I’ll read a post that is just so wrong that it makes me angry. Jeff Atwood wrote a post like that: Please Don’t Learn To Code

To those who argue programming is an essential skill we should be teaching our children, right up there with reading, writing, and arithmetic: can you explain to me how Michael Bloomberg would be better at his day to day job of leading the largest city in the USA if he woke up one morning as a crack Java coder? It is obvious to me how being a skilled reader, a skilled writer, and at least high school level math are fundamental to performing the job of a politician. Or at any job, for that matter. But understanding variables and functions, pointers and recursion? I can’t see it.

Look, I love programming. I also believe programming is important … in the right context, for some people. But so are a lot of skills. I would no more urge everyone to learn programming than I would urge everyone to learn plumbing. That’d be ridiculous, right?

On the contrary: being able to think computationally and algorithmically should be a fundamental skill that’s possessed by modern humans, whether it’s a skill that they use on a professional basis in their lives or not. Every day I have to deal with a world full of people who show little or no ability to think clearly, and some level of being forced to develop some chunk of code to the point where it works correctly has to be a positive thing for people to know how to do, even if they never do it again.

When she was in graduate school, my wife had to take a class that required homework to be done in a spreadsheet. I did my best (and failed) to teach her how to use formulas and macros, but then I’d walk back into the room and see her summing columns with a calculator and typing the value into a cell.

Atwood is right that the goal of programming is to solve a problem, but he makes it sound like that’s a dirty thing, and the highest goal of a programmer is to duct tape together pre-existing modules and collect a check. Leaving aside the question of where those modules come from in the first place  (coded up by elves, I suppose) too often that approach leads to systems that are limited to the capabilities of those off the shelf modules and even more limited by the duct tape developers who lack the capability, imagination, time, or foresight to go beyond those limitations. We’ve made a lot of money over the years gutting and replacing these systems, and maybe even more building systems for clients whose in-house developers told them couldn’t be built at all.

I didn’t even intend to write software — I studied composition in college, and had to learn to write code in C for an electronic music class. It was only after I had enough experience as a developer that I was able to build tools that were a perfect solution to problems that I had as a composer and musician. Learning to program made me a better composer by teaching me a different fundamental modality of thinking, and being a composer has made me a better programmer. If you can successfully write a four voice fugue using common practice harmony, I can teach you to write bulletproof multithreaded code (here’s an article on one of my first real products that was a multithreaded DOS app that had at the time been running 24/7 for a decade).

I believe that everyone should learn to write a little code, and play an instrument, and make things out of wood, and tend a garden, and cook, and, yes, do a little plumbing, too. They shouldn’t learn these things because they’ll use them every day to earn a paycheck, they should learn them because it makes them better thinkers, and better able to take care of themselves. On top of that — if vast empires were being built on top of plumbing the way that they’re being built on software, I’d say that anyone who was happy to ignore it as a black art practiced by wizards was making a big mistake. The value of acquiring a new mode of thinking isn’t affected by the fact that most people won’t need to use pointers or recursion on a daily basis.

When my wife and I had our first child, my germ-phobic wife had a very  hard time with the pediatrician’s assurance that it was okay for our baby to put everything in his mouth, and that doing so was part of how he would learn about the world. I think that the way I learn things is by writing code about them. I don’t know if telling people to not explore that is being elitist, or condescending, or what, but it definitely strikes me as being very wrong.

Edit: There have been many many other similar responses to Atwood’s piece. I think that my favorite one is by Al Sweigart: A Modest Proposal: Please Don’t Learn to Code Because It Will Damage Your Tiny Brain

Edit 2: …or a much less snarky one that takes us back to the ancient Greeks from Vivek Haldar (always worth reading): Executable Thought