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.

Blast From the Past

Boing Boing, with it’s love of red and anti-red comics made me remember Herluf Bidstrup. You see, for some reason in the Soviet Union multiframe format comics were seen as a western influence, despite their usefulness as a propaganda tool. Single and two-frame caricatures were common though. One glaring exception to the rule were comics of a Danish illustrator Herluf Bidstrup, who worked for a Danish communist newspaper. His work was published in a 5-volume set of coffee table books.

The fifth volume was all political, and thus particularly interesting to the Soviet reader. But the other 4 were full of amazingly drawn multi-frame comics that showcased Bidstrup’s eye for little things in life and his crisp, flowing line. I spent hours upon hours looking at his cartoons. Unfortunately we left the books behind, but I will absolutely replace them (I’ve seen them for sale in a Russian bookstore, but balked at the price).

Here you can find some political editorial cartoons and everyday sketches, probably from the last volume at pretty good resolution. These include sketches from his visit to the Soviet Union.

This site, on the other hand has a lot of the good stuff from the first four volumes, alas at a terrible resolution that absolutely destroys Bidstrup’s elegant line. Here’s a similar site.

Bidstrup was pretty much anti-US. Here’s Denmark scared by the Soviet menace joins the Nato. These are just few frames out of a longer sequence.

I absolutely love Bidstrup’s take on the generational conflict and his other cartoons about families. This is another favorite of mine.

Sometimes he just could not help himself and drew pinup girls, and the editors of his books were forced to add politically motivated copy: this cartoon’s title said something about how “this Bulgarian Eve is safe in the Garden of Socialism” or some such nonsense. I think it’s just that Bidstrup liked exotic women in bikinis (forgetting to thank Uncle Sam for the bikini, of course).

I bet that if he were born in the US Bidstrup would have become one of the finest pulp illustrators. I wonder if he illustrated any sci-fi at all…

Oh, and another thing. To this day I prefer cigars that taper on ends because they were prominently featured in Bidstrup’s cartoons. These are collectively called “figurados” and are rather uncommon in the American market. The type that tapers on both ends is called “perfecto” and the one that tapers on one end is called “torpedo”. These are hard to roll, so usually only experienced rollers venture to make them.