Now I have heard everything. I was doing my Saturday morning ritual, Panera Bread, going through various reading material, both in print and online. Got a new copy of the IEEE transactions on Software Engineering and looked at the second article.
Now for those who’ve never been programmers of any sort, let me put it this way: the act and result of coding elicits the creative instincts in people many ways. Sometimes its the algorithm itself, the steps to solving the problem at hand. Sometimes it is in the descriptions and metaphors used to describe someone else’s code, which can range from naturalistic, mechanistic, industrial, post-industrial, dietetic, and space-age and sometime scatological. We can say that a piece of code is “scary” or “tight”. We can say it’s “shitty” or “clean”. We can say it’s “spaghetti” or “straight-line”. From the hardware side of things we have the concept of a “rat’s nest” and a “dead bug” (The former being a tangle of wires, the latter actually being a chip flipped on its back on top of another chip used process a signal in a different way because of a flaw found). Anyway the “spaghetti” vs “straight-line” code are actually both pejoratives.
Spaghetti usually refers to code that is almost in comprehensible in the paths through which you go through it. It’s sort of the software equivalent of a “rat’s nest”. “Straight-line” usually means someone doesn’t know how to code, and just writes exactly what to do, line after line. Usually people grow out of that with training (or they stop coding).
So back to my reading material. The second article in this months Transactions got me laughing. The writers introduced me to a new metaphor…almost a euphemism for shitty (since this is a trade and scholarly publication). Here’s the name of the article:
A Method for Specification and Detection of Code and Design Smells
I almost spit up my coffee. Actually I did spit up my coffee…when I read the first paragraph. And I quote:
“Software systems need to evolve continually to cope with ever-changing requirements and environments. However, opposite to design patterns, code and design smells – “poor” solutions to recurring implementation and design problems – may hinder their evolution by making it hard for software engineers to carry out their changes.”
I was rip roaring at this point. Smell? ok so I suppose by calling code “shitty” it evokes smell as well as other characteristics but “Smell” on its own just got to me.
About the third paragraph the writers pay homage to the ancient metaphor:
“One example of a design smell is the Spaghetti Code anti-pattern, which is characteristic of procedural thinking in object-oriented code.”
Why thank you…
Anyway the article goes on for a few pages and Section 2 is called “Description of Smells”
I was having a hard time keeping myself contained at this point. Section 2.2 was “Detection Techniques” none of which were olfactory I was glad to find out.
Later on they provide a table of “Smells” creating a new category for bad code with this metaphor
- functional decomposition
- swiss army knife
All I have to say is that abstracting that up to the metaphor of “Smell” just didn’t work. Maybe this is a post-industrial answer to diving into the code…a biological explanation for what was once considered “detective” work.
They end the article by saying that “The detection of smells is important to improve the quality of software systems…”
I just don’t think I’ll be going around to the software engineers on my team asking them if they have found any smells in the code. But maybe the idea will catch on and years from now, with noses curled we’ll look at our coding past and remember the day we had to refactor a smell…rather than talk about our coding “war-stories”