Ian Bank

The Problem With Code Reuse and Abstraction

Currently I am neck deep in some multi-layered multi-moduled code that I inherited from some consultants. Younger developers who work with me are also upset with the convolutions, but they are convinced that their way of snapping together Lego blocks is vastly superior and much more maintainable. Just like the consultants though they believe that the more modular, abstract and generic they make their code - the better it is, even if they are building a one-off super specific application. Modularity and code reuse is their number one priority, only then followed by performance, brevity, and lack of bugs.

Development frameworks and code reuse that they promote seem to the the way things are going these days. I was reminded of this trend when I was reading this passage in Ian Bank's "The Bridge" today:

""Are there laws against what they did?"
"There's no law to permit it, Orr, that's the point. Good grief man, you can't have people going off and doing things just because they want to, just because they think something up! You have to have a... a framework""

Don't get me wrong, I am all for code reuse, abstractions and other such fineries. It's just that I tend to look at certain tasks and think - there's a piece of custom code needed here! The younger developers always look at me with great disapproval and tell me that I should use module X or Y, or how they are working on a module that will cover all problems of this kind in a generic way.

Today I came upon a perfect metaphor for such thinking. Apparently it originated from an origami forum, but it seems to me I encountered it in Fidonet signature years ago. In any case, the quote goes like this:

"An elephant consists of a trunk, ears, and a hippopotamus".

When you are building things out of Lego blocks, you must fight the temptation to substitute a hippo for the starting point of an elephant. It looks like Lego did mess up the young minds just the way Sir Harold Kroto said when he delivered a crotch punch to the Lego sales:

"New toys (mainly Lego) have led to the extinction of Meccano and this has been a major disaster as far as the education of our young engineers and scientists is concerned. Lego is a technically trivial plaything and kids love it partly because it is so simple and partly because it is seductively coloured. However it is only a toy, whereas Meccano is a real engineering kit and it teaches one skill which I consider to be the most important that anyone can acquire: This is the sensitive touch needed to thread a nut on a bolt and tighten them with a screwdriver and spanner just enough that they stay locked, but not so tightly that the thread is stripped or they cannot be unscrewed."

If I knew about some of the things that were lurking in the codebase I'm working with now, I'd work something like this into my hiring contract:

"In April of 2000 while on a business trip I received a near-frantic email from someone with an unusual request. It seems that she represented a fellow with a company in Seattle (no, NOT Microsoft). Turns out that last September this guy was hired, and in his contract of employment it stipulated that he wanted a desk made out of LEGO."

Sometimes I am also reminded of other classics of early Internet literature.


Syndicate content

Unpaid ads:

Learn about business at FastCompany and Inc magazines.

Stackoverflow is the most addictive developer's resource. Go check it out now! I use it myself, and I got to tell ya, they don't call it "crack overflow" for nothing.

Joel helped me find my current job. Check out the Joel on Software job board if you are not happy with yours.

WestNIC provides reliable reseller hosting services across the globe.

Evernote is the best code, memo, photo, todo, wishlist application I've ever used. Mad props for making Memex real.

A group of excellent web developers

More Unpaid Ads:

Jesse Reklaw's Slow Wave comics absolutely rock!. Jesse designed Deadprogrammer.com corner graphic, the one with the programmer and the cat. And now you can buy his new book - The Night of Your life:

Dust and Rust - a pretty good New York photoblog.



What's All this Then?

My name is Michael Krakovskiy, and this is my blog.

Here's what you might find interesting:
100 Views of the Empire State Building project: I try to take 100 interesting photos of Manhattan's (sadly) tallest building.

My Gastronomic Adventures: I eat weird food - from 13 year old New Coke to Durian and parasitic fungi.

My attempts to grow exotic plants: pineapples, coconuts, etc.

My photos, mostly of New York City.

My musings about architecture mostly illustrated with my own photos. Would you like to learn about a mental patient who died at 103 who served as a model for some very famous sculptures? How about Brooklyn's ugliest building? How about a wooden skyscraper?

I find myself frequently writing about logos. The most popular article I ever wrote is about the redesigns of the Starbucks logo.

I wrote a series of "Best Sci-Fi You Haven't Read" posts:

Psywarrior
Yes, Virginia There Is Synergy
Call Time Police - We've Got a Time Traveler

Other topics that interest me include NYPD, New York City subway system, Japan, and things made out of titanium. On top of all of that, I seem to be interested in pigeions and Rupert Murdoch.

Dear reader, please browse around. You are sure to find something interesting. I could really use some help in bringing in readership: subscribe to the rss feed, digg the stories (there's a convenient button at the bottom of every article), link to my blog from yours, write some comments. I put in a lot of effort into writing, and I really appreciate your attention.

If you don't want all this pseudo-intellectual bullshit and want some lolcats? Please don't go away. Here, I have that stuff too. Here, here's another. And another. And another. I lied about not posting cat pictures.

    follow me on Twitter