Roedy Green in his funny article "How To Write Unmaintainable Code" says: In 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!"
The funniest tips I found are these:
7hErE aRE mANy 0thEr fUN__nY tIp5. CHe_c_K i_T.
Link:
The Full article: http://thc.org/root/phun/unmaintain.html
The funniest tips I found are these:
- Use accented characters on variable names. E.g.
typedef struct { int i; } ínt;
where the second ํnt's ํ is actually i-acute. With only a simple text editor, it's nearly impossible to distinguish the slant of the accent mark. - Extended ASCII characters are perfectly valid as variable names, including ß, Ð, and ñ characters. They are almost impossible to type without copying/pasting in a simple text editor.
- Choose variable names that masquerade as mathematical operators, e.g.:
openParen = (slash + asterix) / equals; - Never use i for the innermost loop variable. Use anything but. Use i liberally for any other purpose especially for non-int variables. Similarly use n as a loop index.
- Discourage any attempt to use external maintenance contractors by peppering your code with insulting references to other leading software companies, especial anyone who might be contracted to do the work. e.g.:
/*
The optimised inner loop. This stuff is too clever for the
dullard at Software Services Inc., who would probably use 50 times as
memory & time using the dumb routines in.
*/
class clever_SSInc
{
.. .
}
If possible, put insulting stuff in syntactically significant parts of the code, as well as just the comments so that management will probably break the code if they try to sanitise it before sending it out for maintenance.
7hErE aRE mANy 0thEr fUN__nY tIp5. CHe_c_K i_T.
Link:
The Full article: http://thc.org/root/phun/unmaintain.html