Hilarious article: How To Write Unmaintainable Code

Roy posted a link to a hilarious article about how to write unmaintainable code. Since last year I converted a VB6 application to ASP, I really understand Roy. I think the author of the original application must have read this article, before he started coding! ;-)

My favourites:

  • Be Abstract: In naming functions and variables, make heavy use of abstract words like it, everything, data, handle, stuff, do, routine, perform and the digits e.g. routineX48, PerformDataFunction, DoIt, HandleStuff and do_args_method.
  • Document How Not Why: Document only the details of what a program does, not what it is attempting to accomplish. That way, if there is a bug, the fixer will have no clue what the code should be doing.
  • Let's start off with probably the most fiendish technique ever devised: Compile the code to an executable. If it works, then just make one or two small little changes in the source code...in each module. But don't bother recompiling these. You can do that later when you have more time, and when there's time for debugging. When the hapless maintenance programmer years later makes a change and the code no longer works, she will erroneously assume it must be something she recently changed. You will send her off on a wild goose chase that will keep her busy for weeks.
  • The more changes you can make between versions the better, you don't want users to become bored with the same old API or user interface year after year. Finally, if you can make this change without the users noticing, this is better still - it will keep them on their toes, and keep them from becoming complacent.

1 Comment

  • Yeah - that was circulating awhile back. I sent it to my CS professor who was quite a nut about maintainable code and style.





    I thought it was a lot funnier until I dealt with code that prescribed to a few of the techniques mentioned. Apparently, whoever wrote the code thought this article was not being sarcastic :)

Comments have been disabled for this content.