Wednesday, December 30, 2009

Architecture Backpacks

I just saw the movie "Up in the Air" with George Clooney. I don't mean to suggest that George was with me when I saw it, only that George, well... you know.. was in the, nevermind. He plays the part of a professional "Displacement Manager", i.e. he is hired to fire people - and he's very good at it. It's the kind of show where you love the movie, but hate most of the message.

As a side job, Clooney's character gives the world's worst motivational presentations. How he ever lands a speaking engagement is one of those Hollywood riddles that you just have to accept. Kind of like the new Star Trek movie when young Kirk is marooned on an alien world which is close enough to witness the total destruction of a neighboring planet, but somehow is unaffected by the gravitational distortion. I'm such a geek.

In Up in the Air, Clooney's character uses a backpack as a metaphor for all of the things in your life that are holding you back. For example; friends, relatives, spouses, co-workers, and such. He says these are things you throw in your backpack that just weigh you down, hold you back, make you unsuccessful. (This is his "motivational" message!). Please George, don't become a counselor.

Clooney's motivational lack of elegance notwithstanding, the backpack metaphor can be applied to our work as architects, developers, and project managers. Every project comes with certain challenges such as costs or time lines that causes us to forgo perfection. We learn to accept low quality code, obfuscated APIs, fragile connections, magic numbers, and stupid coding tricks just to make our time / cost estimates.

As Clooney suggests, these weigh us down, reduce our satisfaction and infuse errors and performance problems into our systems. This baggage holds us back, keeping us tied to systems from which we'd like to progress away. This year, find something in your backpack to get rid of. This might mean revisiting an existing solution on the down low and replacing a hack with a hooray!

Maybe you can lighten your backpack by committing to never using a magic number in your code. For instance:

for( int x = 0; x<=9; x++ ) {
// some code

In this instance, '9' is a magic number. Why 9? Why not 8 or 10? Yes, yes, I get it, you want to loop 10 times, but why? How about:

static final int MAX_ALLOWABLE_ACCOUNTS = 10;

for( int x = 0; x < MAX_ALLOWABLE_ACCOUNTS; x++) {
// some code

The next developer to touch this code (assuming an IQ over 12) is at the very least going to ask, "Why do we only allow 10 accounts?" This becomes a business question that will yield a better understanding of both the business model, the program code, as well as a lighter backpack for both you and the next coder.

This change takes no additional time, costs zero additional dollars, improves the understanding of the business, reduces future maintenance time, and lightens the backpack for everybody. If that isn't motivation enough, maybe we could arrange a one on one with George Clooney.

No comments:

Post a Comment

Follow by Email