Re: Contempt Culture

Two weeks ago Aurynn Shaw wrote a piece called “Contempt Culture”:

And even before I finished reading it I had a thought:

Oh, this is not the article I expected to be reading.

So here’s the article I thought I was going to read, based on the tweet. A short version, anyway.

Recommendations

A few weeks ago I asked people a question on Twitter:

I got many interesting responses, but one of them asked if I had any recommendations for books on compilers.

Oh gosh. Books? Books about computer science? I’m actually not very well-read: while I’ve been programming since I was a kid, I “only” have an undergraduate formal education. That means the set of books I’ve read about CS is rather haphazard. But I suppose I do have a few things that come to mind.

Dealing with "Sandwich Code"

I came across the term “sandwich code” for the first time recently as part of the Ruby Koans Ruby tutorial. It’s not a common term (yet?), but refers to a common resource management problem. Here’s how a lot of people are usually introduced to it:

// Top slice of bread
FILE *f = fopen("file.txt", "r");

// The meat (or other filling, if it's a vegetarian sandwich)
if (f) {
    processLinesInFile(f);
}

// Bottom slice of bread
fclose(f);

This is okay. In fact it’s completely correct code, and…