Entries from July 2005 ↓

The Brilliant Supervisionary Genius in the Oval House

One of the most popular, and most odious, conservative blogs out there is called Powerline. I will not link to it, as I don’t want its rightwing nutjob cooties all over doodleplex, but I have to mention this, from one of their recent posts:

It must be very strange to be President Bush. A man of extraordinary vision and brilliance approaching to genius, he can’t get anyone to notice. He is like a great painter or musician who is ahead of his time, and who unveils one masterpiece after another to a reception that, when not bored, is hostile. (via kos)

Now, this would be a hilarious gag on Saturday Night Live or the Daily Show: some old British dude sitting in an overstuffed armchair waxing hyperbolic on Bush’s unacknowledged genius. And it would just be mildly annoying if the guy who wrote this was throwing up misinformation to befuddle the befuddleable elements of the body politic. But I have a feeling that this son of a bitch is serious. And that’s just scary.

Model! View! Controller!

The Model/View/Controller paradigm has been around since 1979, when Trygve Reenskaug came up with what is arguably one of the most influential concepts in modern software history. Twenty five years later, it still forms the underpinnings of the vast majority of our user interfaces, and has extended beyond the realm of rich client design to serve as the guiding light for web frameworks that trying to make the painful process of designing complex web applications on top of dumb, stateless communication protocols a little bit less traumatic.

But what is MVC, really? You can’t quite call it a pattern, because it’s more than a simple design precept: it’s really an entire way of thinking, one that emphasizes component isolation in the service of flexibility. This separation of concerns is the key concept that MVC brings to the table.

Specifics, now:

  1. Model: A model is a virtual representation of some external entity. Ideally, it’s fully encapsulated — which is to say, it implements nothing more and nothing less than the important aspects of its real-world analog. It is completely and monomaniacally self-obsessed.

  2. View: The visual representation of your system. This is what users see when they look at their monitors, the tip of your application’s iceberg. More to the point, it presents the contents of the model, and does so without knowing very much at all about the details of that model’s implementation.

  3. Controller: So far, we’ve described two largely inert components: a model that’s pretty much satisfied with just hanging out and being itself, and a view that mostly just cares about preening for users and strutting its stuff. Something has to serve as the motive force in this closed little world, and that’s where the controller comes in. It’s the one that reacts to external events, performs whatever business logic is necessary, and updates the model (and possibly the view) with the results.

This may seem like a lot of trouble to go through for a simple UI, but the division of labor inherent in this approach, and the opportunities for loose coupling that it affords you, are really quite important. In the bad old days, when interactive program design was just a barely evolved slug-creature pulling itself out of the protoplasmic muck of creation, all of these components were munged together into one unseemly undifferentiated blob. Which meant that every time you wanted to change some aspect of the program’s UI, you’d probably have to get the model involved, whether or not it really needed to be; and vice versa. Everything was tightly coupled, and the parts of the system that should have been stable were inextricably linked to the parts that weren’t. Nothing was safe.

Things have steadily improved since those dark days. In some sense, you could say that the history of software design has been an ever more desperate effort to isolate volatility.

Let’s think about this in different terms. Imagine a movie theater. If you were to recast its essential components in the light of MVC, then the view would be the screen, the model would be the movie reel, and the controller would be the projector. The beauty of this arrangement is that you can take any movie and drop it into any projector and display it on any screen. It’s a simple question of shuffling around compatible, but loosely-coupled, components,

Now what if these components were combined? What if a movie theater was a single monolithic entity, in which the movie, the projector, and the screen were all shipped as one package. Whenever a new movie came out, someone would have to build a new theater, install the movie/projector/screen, and show it. When they wanted to show a different movie, they could either (a) tear down the theater and build a new one or (b) hire a team of contractors to come in with drills and hacksaws and sledgehammers and remove the old movie and install a new one, hoping that the new reel would work with the old projector. Probably it wouldn’t: you’d need major modifications to the hardware, which would likely require modifications to the screen, and so on.

So separation of concerns is a good thing. That’s fairly obvious, I think. But once you get down to actually trying to implement this stuff, things get a lot muddier.

More on that later.

Ramble On

I’m sitting in a foreign Starbucks, in the far Northern Kingdom of Frederick, watching two flies locked in some sort of martial/marital embrace, spinning down to the ground in a frantic death spiral. Fine by me. I’m not much of a fan of flies, or any insects, really. I mean, they’re not as bad as geese, but still: they’re icky and crawly and many-legged, and they wear their skeletons on the outside of their bodies, which is just obscene.

I once read a particularly bad Stephen King story called The Mist, in which a crack opens up in the fabric of space/time and all of these large insectile creatures tramp into our dimension and start kicking ass. I think that’s what it was about, anyway. The only thing I can really remember is the image of a huge cockroach seen from below, trundling At-At-like across a misty, ruined landscape. I wish I hadn’t read that story. It makes me feel all oogy. Soon afterwards, I read another King story in which a guy trapped starving on a desert island starts cutting off pieces of himself and eating them. That story bothers me a lot less. I think that says something very troubling about my mental state, but I’m not sure what it might be.

I once woke up from a bad dream to find my skin grown cracked and desiccated, like a desert landscape. As I watched, the cracks widened, and green shoots of some many-headed broccoli-like thing grew out of the cracks, slowly, inexorably covering my body in a thick carpet of mottled green. And then I woke up again, for real this time, nauseated and retching. To this day, the thought of that dream makes me want to puke.

Yesterday, while walking the hell-beagle, I found a crushed can of Budweiser on the sidewalk; then, turning a corner, another. And then another, a whole line of them, leading off the sidewalk across the lawn of the nearest house and up the stairs to the front stoop, where an open pack of cigarettes lay unattended on a bench, and a child’s bike leaned against the railing. It was like I’d stumbled into the alcoholic’s edition of Hansel and Grettel. The juxtaposition of the bike with these strewn paraphernalia of minor vice was faintly disquieting. And then the beagle tried to ingest the remains of a dead squirrel, and I forgot all about it.

Annie Difranco says:

And they say that alcoholics
Are always alcoholics
Even when they’re dry as my lips
For years
Even when they’re stranded on small desert islands
With noplace in two thousand miles to buy beer

And I wonder is he different
Is he different
Has he changed
What he’s about
Or is he just a liar
With nothing to lie about

So here’s what I’m saying, basically: I don’t feel like doing any writing this morning. I think the best thing to do when you don’t feel like writing is to write something else. One of my teachers told me to write letters, but letters are a quaint anachronism in this our electronic age, so I can’t do that. So I thought I’d just do a generalized thought-spew instead, and see where that got me.

Not very far, alas. I now have something else to not feel like doing anymore.

35

I have trouble remembering how old I am. There just isn’t enough spare retentive capacity in my tiny little one-bedroom mind to waste on another number, so I don’t. This hasn’t been a problem, though: I was born in 1970, so the calculation is particularly simple, even for me.

However, as I approach my thirty-fifth year, it occurs to me that I might eventually start forgetting how old I am not because I can’t remember, but because I don’t want to. I’m not feeling particularly old at the moment, but that may change when death begins to purple my horizon.

All of which agrees nicely with my Theory of False Stasis, which goes something like this: It’s not that people don’t change; they just find different ways to stay the same.

Schadenrove

Schadenrove: Happiness at the misfortune of Karl Rove.

I’ve been watching the slow outing of Karl Rove with a giddy kind of joy for the past couple of weeks. It’s now clear that he’s the one who told Time magazine that Joseph Wilson’s wife was an undercover CIA operative. Wilson had just written an editorial debunking the administration’s carefully-worded claim that Iraq had sought the makings of a nuclear weapon from Niger, and this was SS Rove’s shot across Wilson’s bow: stop fucking with us before someone gets hurt. Given Rove’s cultivated image as Bush’s evil enabler, though, I’m not sure how much political hay the democrats are going to get out of this. It’s like Darth Vader admitting he occasionally jaywalks.

But still: it’s something. This administration has been remarkably successful at hiding its clearly visible mountains of malfeasance behind limp denials and implacable stonewalling; they’ve gotten away with so much in plain sight that a revelation of actual backroom wrongdoing seems almost miraculous.

And funny. Rove’s latest denial: I never told anymore her actual name. All he did was mention the person who’s married to Joseph Wilson, which is to say his wife, the wife of Joseph Wilson, the one standing over there, in the brown suit talking to that other lady, yeah, that one. No no, that one. Right. Yeah. She’s an undercover CIA operative. But I won’t give you her name. That’d be illegal.

This is, of course, the Republicans’ “is is” moment — as in Bill Clinton’s painful dodge during his Lewinski deposition, in which he uttered the fateful phrase: “That depends on what the definition of is … is.” That was just as laughable then as Rove’s circumlocutions are now, but the stakes were slightly different: Clinton was trying to hide an embarrassing affair with an intern; Rove is trying to conceal his role in outing a CIA operative, endangering her life in the process. What a devil weasel that man is.

Happiness

Magpie waxes brilliant:

I’ve learnt that happiness isn’t located anywhere that you can actually get on a plane and fly to. You have to build your own little stash of happy that you take with you wherever you go. And without that, there’s nowhere you can be where you won’t feel lost.

Stash of happy. I love that.

The 39 Steps

I’m cleaning out my room this weekend. Over the past six years, I’ve managed to cram about three tons of papers/receipts/batwings/rubber brains/catalogs/maps/eyelashes/magazines/etc into a space about the size of a washing machine, and it’s about to explode: I can hear it creaking and shifting and groaning around me, all that massy mass, the weight of my past bearing in on me, too heavy now for the the delicate infrastructure of my present.

I’ve committed myself to shredding every piece of paper I absolutely don’t need, but that turns out to be very difficult: I have lots of copies of old stories hanging around, marked over and crossed out and crumpled up. I don’t need them anymore, I’ll never look at them again, and I have the originals on disk, backed up in several places, but still: it’s like flushing pictures of your children down the toilet.

While in the midst of this painful task, I came across a wonderful document that I picked up during one of my writing classes: The 39 Steps: A Primer on Short Story Writing. It’s a list of really useful tips on how to go about making short fiction, and manages to be irreverent, practical, and indispensable all at once. Some samples:

Step one in the great enterprise of a new and preferable you in the house of fiction is: Mean less. That is, don’t mean so much. Make up a story, screw around with it, paste junk on it, needle the characters, make them say queer stuff, go bad places, insert new people at inopportune moments, do some drive-bys. Make it up, please.

Remember: Many things have happened which, to the untrained eye, appear interesting.

At every turn, ask yourself if you’re being gullible, dopey, pretentious, cloying, adolescent, Neanderthal, routine, dull, smarty-pants, clever, arty, etc. You don’t want to be being these things.

Organize the story’s structure around the simplest available strategy. For example, if there’s no obliging reason that the story be told in flashbacks, don’t use flashbacks. Don’t use flashbacks simply because you get to a certain point and then think of something that requires telling in flashback if it is to be told at that point. Instead, return to the front of the story and add the material in its appropriate spot.

If you write a sentence that isn’t poignant, touching, funny, intriguing, inviting, etc., take it out before you finish the work. Don’t just leave it there. Don’t let anyone see it.

To repeat, there is no place for rubbish & slop in the highly modern world of today’s fiction. Every sentence must pay, must somehow thrill. Every one.

I’ve broken almost of all of these rules, and some of them I break on a regular basis. I find the last one, in particular, terrifying. Do readers really expect that of us? Every sentence? Who do we look like, Neal Stephenson?

Form Over Function in the Web World

I’m been watching a really fascinating series of talks over at The Server Side, on the subject of J2EE best practices and project failures and scalability and all manner of serious geekaliciousness. Even better, I’m watching it right in my browser, on this neat Flash viewer that displays the video stream on the left, and the presentation slides on the right. This is great because it eliminates annoying cutaways to projector when new slides are presented, and allows the camera to stay focused exclusively on the geeks.

But I do have a gripe with this viewer, and it applies to many other web UIs I’ve seen around recently. The video stream window has a progress bar underneath it, but no other visible controls. There’s no obvious way pause the stream or rewind it or stop it or do anything at all besides (a) look at it or (b) not look at it. This annoyed me, and I was running my mouse over the progress bar in an impotent show of rage, when a control panel slid down off it and onto the page.

Now … sure, that’s a neat effect. But why? It’s not like there are any space constraints; there’s plenty of room on the page. And this isn’t an overly complicated set of controls, either, so there’s no question of overwhelming the user with complexity. That leaves aesthetics: it just looks cooler.

I think this is a terrible mistake. Although UIs must look good, their most important function is to be instantly intuitive. Armed with a few bedrock axioms — buttons are for pushing, checkboxes are for checking, scrollbars are for dragging — all users should be able to figure out the basic functions of any UI, instantly.

The problem here is that there’s no indication that the controls are there. You know they should be there, of course, but that’s all you have: assumptions. If the developers insist on including this effect, they should make the controls initially visible, and provide a way for the user to fold them up out of sight, if they’d like.

Another example of this trend: non-underlined HTML links. Links should always be underlined, because even web neophytes know that underlined text will take you somewhere else when you click on it (inversely, underlines should not be used for any other purpose). But lots and lots of sites use colors to indicate links, instead. This is a problem because (a) it’s not the standard, (b) pages use colored text for completely different purposes, and (c) there’s no good reason (beyond aesthetics) to not use underlines.

This is a small and trivial example, granted, and, probably not so valid anymore: color-links are so ubiquitous that they might as well be the standard. But now you’ve got two standards … underlined links, and colored links. Not a big deal, in and of itself, but when piled on top all of the other inconsistencies and complexities we find in our journey through the web (and through the world), it becomes important. Computers are too damn hard to use as it is. No need to make it worse.