Saturday, February 26, 2005

[geek][politics] OOT: Object-Oriented Thinking (or, "The Secret Languages of Code")

Okay, I lied. Sorta. This'll be geek and politics, in one entry - and I'm not even going to be discussing Open Source or Intellectual Property, or PATRIOT Act-enabled snooping, or the hiring of Gator's CPO by Homeland Security. Nope. I'm going to be talking about language, metaphor, and a book. More specifically, this book: So, I'm reading this book, and so far (I'm about 2/3s through it), I'm feeling kind of conflicted about it. One of Dr. West's theses is that better software is produced by better programmers. Okay, I'll buy that. The other major premise of the book is that the way to get better programmers is to get them thinking about their code properly, ie. as objects. Now, this is probably old hat for anyone sticking it out this long, but for those of you playing along at home, object-oriented programming is about abstracting entities into code, encapsulating data within, well, an object. Your program then exposes those properties (data elements) and methods (actions) that you desire: a button on a program has a title - this is a property; the button responds to being clicked by a mouse - this is a method (yeah, I know - in most GUI environments, it raises an event or otherwise sends a message, but still...). The idea is that you consciously model a construct in code. West makes the case that a central element of object-oriented thinking is missing from most discussions (and implementations) of the topic: behavior. He would like to see objects discussed less in formalistic terms of methods and properties but rather how best do we model the desired behavior. So, what does this have to do with politics? Well, I was quite surprised to see West refer to Dr. George Lakoff's linguistic theories. Lakoff, for those unfamiliar with his work, has built his career around the concept (grossly oversimplified) that the language we use influences the way we think and the way we think influences the language we choose. Both the language we choose and the way we think in turn have the combined effect of defining what is 'real' to us. Lakoff is currently the darling of many intellectual Democrats and progressives - they talk about 'framing' and 'memes' and actively changing the debate. I take a somewhat less idealized view of things - George Luntz, the GOP pollster/strategist, is actively out there researching words and phrases that work instead of merely talking about it; the man coined the phrase 'death tax', by way of illustration. I wish I could take credit for this analogy, but someone I recently read observed that Lakoff is the theoretical physicist, but Luntz is the guy with the particle accelerator, smashing ideas together and seeing how words spin off. Personally, I'm of the opinion that we need more people like Luntz than Lakoff, but that's another entry for another day... Actually, West does more than refer to Lakoff - he posits that the proper way to think about objects is to think about their behavior - not about what specifically they do, but broadly what they need to do. He believes that we as programmers spend way too much time trying to build requirement upon requirement into our classes and objects, and that if we'd just back off, we'd design simpler objects which would in turn lead to better software. He lays out a compelling case, that changing our language will change the way we think about our software. In changing the way we think about our software, we will be fundamentally altering the landscape in which our software operates. He lays out a compelling vision, depicting a titanic class between formalist culture and relativist culture, technocrats and managers against geeks and artists. On an emotional level, I get it. At an intellectual level, I get it. The process he's describing, the methodology he proposes, totally gel with the way I've long thought about my programs. Even when I was writing largely procedural code, I was holding in my head metaphors that made it a lot easier for me to visualize what I was trying to achieve. West believes that by training developers to accept fuzziness and chaos, to embrace uncertainty and relativism, to adopt an almost Zen-like approach to software-by-metaphor, better software will come about. Here is where I think the book falls short: I want to believe it (really, really, really). So much of it meshes so well with my own outlook, and the density of supporting material is astounding. But overall, I think the tone is too messianic to be persuasive to anyone who hasn't already been sipping at the Kool Aid. Another problem with the book is the vocabulary (and, to a degree, the density of the supporting material). You can tell this book was written by an academic - for instance, I've never seen another programming book use the word 'hermeneutics' or make reference to Heidegger. Philosophy, yes. Programming, no. I work with a recently-naturalized Korean American - he won't make it past the introduction of this book. I work with a well-educated and well-read but somewhat conservative programmer - he won't make it past the first chapter because of the almost mystical fervor with which Dr. West approaches this topic. Reading this book has shown me places where I haven't been writing 'true' object-oriented code. Some of that is the nature of working with a strongly-typed language, but much of it has been instances where my earlier conditioning was coming through. Objectively looking at the code in question, I wasn't happy with it but couldn't quite figure out why. In this regard, the book has already provided some valuable insight. In short, I this book is almost a Gnostic text of sorts - to the believer or not-quite-believer actively seeking the message this book tries deliver, it will be a wonder. To a skeptic (or traditionalist or dogmatic) not so much (read some of the negative Amazon reviews to get a flavor of the degree of negativity - wow!). Ultimately, that's too bad - I think there's a lot of wonderful material in this book that'll be lost, and I do think my profession will be the less because of it.

0 Comments:

Links to this post:

<< Home