Learning to code

I’ll start with a poll before pontificating:


A recent post on A List Apart, Elevate Web Design At The University Level, brought up something that is near and dear to me: how to make a programmer. I’m sure we all know guru-level programmers that always have an answer or can think one up on the spot, just as I’m sure we all know people that can’t program their way out of a for loop. But how do each of them get that way?

My argument has always been that programming is actually the secondary trait—that is, you shouldn’t aim to be a good programmer but instead should aim to be process-oriented. Because, really, what is programming if not the codification of processes? It’s not that the guru programmers are more intelligent than the clueless ones, it’s really that the gurus can quickly pick a place to start on a problem and can work their way around the problem in a systematic manner. Clueless programmers more often than not need to be shown where to start.

That’s all fine and good, but how do you get to be process-oriented?

My wife the zookeeper would tell you that as higher primates we have an innate predilection for processes, as our ability to learn and repeat is a primary characteristic that separates us from lower animals.

A psychologist would tell you that repetition is comforting. When we can look at what has come before and know how that will affect what is to come, we feel secure.

So if it is hard-wired into our systems, why isn’t everyone a good programmer?

I’d argue that it’s because even though we inherently can follow processes, we’re not necessarily wired to analyze those processes. Orangutans (probably) don’t think about why they make a nest every night, they (probably) just do it because it comforts them and makes it easier to sleep. Obsessive-compulsives (generally) don’t think about why they have to double-check that they did lock the door they just went through, they just know that they need to do it.

My argument then is that process analysis, also known as critical thinking is a learned behavior. So where do we learn it? Where do we learn how to think about what we’re thinking?

Some were lucky enough to have it taught to us as children. The American educational system hasn’t been terribly good about this—it emphasizes the ability to perform repeatable processes (a holdover from its blue-collar middle class roots, I’d imagine), not necessarily to analyze processes. Most lower math classes follow such a system, while it’s only the higher level classes such as Calculus that begin to teach the why part of math. In Algebra were you taught why a²+b²=c² or did that come later? Unfortunately, most American students never make it to Calculus, just Algebra and maybe a little pre-Calc.

We’re therefore relying on exceptional teachers and parents, not just regular ones.

Being back in school for my BS, and just about to graduate, I can categorically say that not a single course has been devoted to process analysis or critical thinking. I can also say that a large number of the people that will be graduating with me are in the clueless-coder category. Of course, I’m not getting a CompSci degree but an InfoTech degree so that might be skewing the results, but I’d counter that process analysis is just as vital in InfoTech as it is in CompSci.

I can think of one of my teachers, not coincidentally one of my favorites, that is vocally frustrated by the lack of critical thinking on the part of his students. He’s a big picture teacher—he likes to drop you in the middle of a problem, give you a specific end goal, and then see how you get there. He doesn’t grade based on your methodology, just on your results. And, more often than not, he’ll give credit for getting half of the way there if it looks like you were on the right track.

That may seem like he’s going easy on students, but he’s not—he’s considered one of the toughest instructors by most of the students, but again not coincidentally, one where you walk away from his classes knowing and retaining more than most others. Without critical thinking skills and process analysis, far too many of his students are dead in the water from the start, and he’s not afraid to call them on it when they whine about not knowing where to start. He’ll tell you to stop, look around, figure out where you can start, and see where that leads you. There’s a reason he refers to himself as a Drill Sergeant for IT.

The part that breaks my heart is that CompSci and InfoTech seem to be the exceptions to the rule for education. Let me quote myself from my comment on the ALA article:

[I]n Engineering you donít talk about steel and concrete in your first year, you talk about statics and dynamics and Newtonian physics—you learn the basic underpinnings first. Why should our field be any different?

Similarly, I wouldn’t expect a Chemistry degree to start you off playing with hydrochloric acid on your first day. For a degree in music you’re going to have courses on Musical Theory and Composition, not just lessons on a musical instrument. For a Sports Medicine degree to become a Physical Trainer you’re going to have to sit through a boatload of biology, anatomy, and physiology, not just kinesthetics and nutrition.

Why, then, are students allowed to skip straight to coding in Java or VB.NET? Why do you learn the difference between functional and procedural programming after you’ve already got exposure to specific languages? Why are concepts like closures and concurrency considered graduate-level material?

How is any one specific programming language more important than the prerequisite ability to think about how to code?

By Rick Osborne

I am a web geek who has been doing this sort of thing entirely too long. I rant, I muse, I whine. That is, I am not at all atypical for my breed.