How To Write Unmaintainable Code

Ensure a Job for Life!

n the interests of creating employment opportunities in the Java programming field, I am passing on these tips from the masters on how to write code that is so difficult to maintain, that the people who come after you will take years to make even the simplest changes. Further, if you follow all these rules religiously, you will even guarantee yourself a lifetime of employment, since no one but you has a hope in hell of maintaining the code. Then again, if you followed all these rules religiously, even you wouldn’t be able to maintain the code!

You don’t want to overdo this. Your code should not look hopelessly unmaintainable, just be that way. Otherwise it stands the risk of being rewritten or refactored.

A few excerpts…

Be polite, Never Assert
Avoid the assert() mechanism, because it could turn a three-day debug fest into a ten minute one.

Bedazzling Names
Choose variable names with irrelevant emotional connotation. e.g.:
marypoppins = (superman + starship) / god;
This confuses the reader because they have difficulty disassociating the emotional connotations of the words from the logic they’re trying to think about.

Use Continuation to hide variables
Instead of using
#define local_var xy_z
break up “xy_z” onto two lines:
#define local_var xy\
_z // local_var OK

That way a global search for xy_z will come up with nothing for that file. To the C preprocessor, the “” at the end of the line means glue this line to the next one.