By John Gruber
Flatfile: Never format messy spreadsheets again.
I took a couple of runs at it. The brackets and pointers threw me off, but I kept on trying because I knew I needed to learn this language to build the apps I wanted to see in this world.
And then one day, I believe when plugging away on my little internet search utility VoodooNetKey, everything clicked.
Pointers, the brackets, selectors, messages. Oh my god, I get it now — the brackets! It’s not a function call, it’s something way better!
Everything just sort of aligned in my brain. Previously I found myself struggling to express the ideas I had in my head, and it was a frustrating experience. Now I was struggling to type fast enough and come up with new ideas that I could express in Objective-C. I felt like I could do anything I wanted with it.
Objective-C is polarizing on a specific axis. It is, objectively (no pun intended1), an unusual language syntactically. Most modern programming languages look roughly the same, but you can spot Objective-C code at a glance. It’s distinctive. It’s different. It’s also difficult and dangerous in the ways that C itself is difficult and dangerous. That’s the nature of Cox’s original gimmick, that Objective-C was a layer of new syntax on top of C, for performance. Objective-C needed to do things C couldn’t do, but syntactically needed to dance around C’s own syntax. Hence all the square brackets.
There are some good programmers who view their source code as their product. The source code they write is, in their minds, the thing they are crafting. And if the source code, by nature of the language itself, is ugly, that’s a non-starter.
There are other good programmers who view the app they are creating as their product. The app is the thing they are creating and the source code is just a part of the process. It’s the difference between crafting code and crafting apps. It’s this latter group — Gus Mueller among them — who sings the praises of Objective-C.
In very rough terms, it’s like the difference between a novel and a screenplay. A novel is the product — the prose is meant to be enjoyed and should, in and of itself, be beautiful. A screenplay is just a means toward an end: making a movie. There’s a reason screenplays aren’t written like novels, and follow strict formatting rules that are, objectively, ugly. Or perhaps — like Objective-C syntax — not ugly per se but brutal.
But, still, you can write a fun-to-read screenplay, and you can write elegant Objective-C source code. I’d rather read a Quentin Tarantino screenplay than most novels. Yet I’d also always rather watch a Quentin Tarantino movie than read his screenplay for it — because that’s the thing he’s working toward. The product. The art.
Objective-C is more than a language and a runtime for computers. Like chisels and marble for a sculptor, Objective-C is a medium for thinking, expression, and creation.
Objective-C offered a small collection of rules on the surface and a deep well of flexibility underneath. This combination facilitated and encouraged quick and playful experimentation.
Objective-C allowed the programmer to wink and say, “I know what I’m doing.” Objective-C winked back and became a willing participant in making the computer do cool stuff.
When I listen to my favorite app developers speak of Objective-C and its runtime, they almost never talk of the source code they wrote. They speak about it like Kocienda does, like it gave them the ability to put their fingers on the apps themselves. Like they weren’t writing instructions to make the app, but that they were writing the app itself. Not writing a recipe for baking a cake, but somehow baking a cake directly, and tweaking it to taste better and look prettier as it’s cooking. And if you needed to write ungainlier-looking recipes to get that on-the-fly dynamic feel for the cake as it’s being made, so be it, because the cake is the thing, not the recipe.
OK, OK, you got me: the pun was fully intended. ↩︎