Friday, July 6, 2012

Sculpting Code to Create and Retain the Art

I read in passing the comment "what if software maintenance was taught the way sculpture is taught". To my dismay nothing more was said in the article about how this might occur. I turned to my friends and colleagues and asked for memories on the pedagogy of teaching sculpture. One person responded "pedagogically? WTH?" which reminded me that not *all* of my acquaintances understand educator-speak. After rephrasing the question to let the confused know that what I wanted was recollections of teaching strategies in a sculpture class, the responses came pouring in. Unfortunately, most of them did not take this deep and meaningful question in the serious light I had in mind.

However, one person said something to this effect: 

"take a chunk of something and remove everything that doesn't look like a horse and you will have a horse".

That was enough to get me thinking about software development and maintenance in a new light. Perhaps a bit less deeply and meaningfully than originally intended. But one must work with what one has. Kind of like creating a sculpture.

Software maintenance a la sculpture would necessitate a top down approach. You have a body of code, thousands and thousands of lines of code (let's say we are working on the scale of Michelangelo's David as opposed to a Chinese tea cup). But in this case, years of helpful modifications have led to a few too many modules and unused and obscure Objects (reflecting my basic dislike of Java). Imagine David with an extra arm or long hair in a pony tail. Perhaps a pair of socks artfully turned down at the ankle. (I'm not going to photoshop this into reality but I invite you to do so and send it my way)

Removing the extra limb (unused modules) shouldn't be too hard - Delete Delete Delete. The primary tricky spot would be making sure that any dead end invocations were eliminated. We wouldn't want David to be left with an extra shoulder beckoning for that third arm to be added back on. The pony tail would be a bit trickier because we don't want to leave anyone with the aftereffects of a bad hair day, but the overall process would be the same.

Removing the socks (obscure Objects) is perhaps the biggest challenge. We don't want to render the feet unable to support the body, nor do we want to damage the elegance of David's stance. Hence, a careful examination of all the connections (direct, indirect) between Objects and identification of inheritance structures is just the beginning. Expert designers and coders with an eye for fine detail will need to be called in.

In the end: Voila! Beautiful, aesthetically pleasing code art of the highest quality. We may be on to something here.

No comments:

Post a Comment