Monday, July 28

Automated Unmaintainable Code

Still working on Nant, just not making a lot of progress.
A long time ago, I came across a humorous article on how to write
unmaintainable code. One of the points was to use the C continuation
operator to break up #defines so that a global search could not find
them. I use the global search quite a bit, so this one stuck in
my head as particularly bad. The other day, I was looking at some
open-source code. It was not indented, so I did a Ctrl-Shift-F in
Eclipse to reformat it. I ran the program, and received an exception.
So I copied the message and did a search to see what was causing
said exception. The search turned up no hits. I kept cutting
down on the words, and eventually, after about half of it was gone,
I found it. The reformat had broken up the string into several short
strings concatenated together. Somehow I find this offensive. It's
a good thing I don't use the Ctrl-Shift-F very often.

No comments: