codahale.com٭blog

This is my old blog. My current writing is here: codahale.com

Joel’s Old: Get The Hell Off My Lawn

I guess someone put a baseball through one of Old Man Spolsky’s windows, because he’s down on the sidewalk shaking his fist at those damn kids:

The lucky kids of JavaSchools are never going to get weird segfaults trying to implement pointer-based hash tables. They’re never going to go stark, raving mad trying to pack things into bits.

Now I realize that Joel’s a total ninja when it comes to software, and I can respect that. But when Grandpa’s out on the porch yelling at the neighborhood toughs wearing only a dress shirt, my sense of filial duty does not override my desire to get him to put some pants on.

Here’s why I think Joel’s call for an Asperger’s Revival is a bit daft.

I agree with him that recursion is an important skill to use. Without recursion, tree structures are ineffable creatures. Nuff said. I also agree with him that functional programming broadens the mind, and I’ve been meaning to pry mine open a bit more by learning Haskell.

That said, I think he’s drunk when he says that learning how to write a linked list using pointers is useful.

To start CS undergrads off with C as a learning language is like tying a brick to the right leg of everyone on the track team: after four years, they’re gonna limp. C constrains the mind; having to micromanage your own memory doesn’t produce great programmers, it produces several decades of buffer overflow vulnerabilities. Keeping function declarations in a separate file from the actual functions is catering to a preprocessor written before I was born. That’s just stupid. Is C useful? Sure. It’s great for low-level stuff, like operating systems and compilers and such. But how much of your day do you spend actually working on that? I don’t write drivers, and trying to implement database-drive intranet applications in C would be like trying to fix a modern F1 race car with a spanner wrench and a jug of greasy moonshine. Somewhere, somehow, someone scary could pull it off, but it’s not something to be done. For me, C is as useless as a buggy whip.

I also think Joel’s a bit quick to dismiss object-oriented programming as spending “countless hours rewriting your code to rejiggle your object hierarchy.” Writing orthagonal, extensible objects is hard work, and reason you do it isn’t to make the code compile any different, for the most part. Yes, yes, you could re-implement anything I do in Ruby or Object Pascal in C or even Assembly (or hell–machine code), but the point isn’t always the compiled binaries. The point should be about writing software which is understandable by other humans and not some sort of horrific train-wreck of curly brackets and semicolons. Lord knows I’ve spent enough time with fools weaned on procedural languages who stuff everything in a class named MyClass. Check out the difference in code between WordPress and any other PHP application and then try to tell me that “rejiggling your object hierarchy” isn’t difficult but worthwhile.

I dunno, maybe Joel just got through managing a small herd of idiots who spent 2 years writing linked lists in Java and he’s a bit fed up with programmers who don’t know what they’re doing. Fair enough. But for each line of code he writes to get around a limitation of his chosen language, there’s another guy writing one that actually does something. Software is a human phenomenon, and the reason we like high-level languages is because we shouldn’t have to “think of things at multiple levels of abstraction simultaneously” when we’re dealing with a goddamned linked list. Low-level hackers have a place of prestige in the world–and rightly so–but to assume that a programmer is the worse for not having been hamstrung by an archaic language directly responsible for decades of truly crap code is just silly. Joel should have reached farther back and chided today’s youth for not keeping track of which registers their code uses. “Kids these days don’t know their cx from their bx!”

C’mon, Grandpa… it’s cold out; come back inside and put some pants on.

2 Responses to “Joel’s Old: Get The Hell Off My Lawn”

  1. Dan The Man Says:

    You’ve managed to completely mis-understand and mis-represent Joel.

    He didn’t say writing linked lists in C is useful in itself. He said writing linked lists in C is a useful test to see if someone deeply understands computers. (Ditto for recursion, functional programming, etc.)

    He didn’t say collages should teach C to freshmen. He said it’s a good way to weed out the people. Would you trust a grad who went to a college and learned only PHP? Obviously not. Java is better, but it’s not the challenge that C is.

    He didn’t say OOP is bad. He made joke about the distinction between software design and the much less important OO design.

    He never said C was his language of choice. In fact, if you read his articles, you’ll find that language isn’t all that important. http://www.joelonsoftware.com/articles/FogBugzIII.html

  2. Coda Says:

    He did say learning to write linked lists in C is useful in and of itself: it teaches you more about the inner workings of the computer, etc., etc., and for whatever reason, pointers seem to be the key to understanding Linux:

    You can’t understand a line of code in Linux, or, indeed, any operating system, without really understanding pointers.

    While he didn’t explicitly say colleges should teach C to freshmen, he did say that C is a good way to cull the herd, and that he thought that culling the herd is something that should be done. The inference is not hard to make (modus ponens).

    And finally, I didn’t accuse Joel of saying OOP is bad. What I said was actually quite precise:

    I also think Joel’s a bit quick to dismiss object-oriented programming as spending “countless hours rewriting your code to rejiggle your object hierarchy.”

    My point, which I think you’ve failed to either understand or acknowledge, and I’m certain you failed to address, is that a fine theoretical grasp of the low-level workings of von Neumann machines is becoming less and less relevant to the general practice of software development, and therefore, less and less relevant to the teaching of software development. (Mind you, software development != computer science.) It doesn’t hurt, but a pedagogy based around the requirements of langauges like C definitely can. Joel obviously has a different opinion on this.

    So put me down for being misunderstood and misrepresented, too.