Write Unmaintainable Code

Every once in a while, I run into this site teaching techniques for writing unmaintainable code. Of course, the hole purpose is to teach exactly the contrary (or at least that’s what I hope). Some of my favorite techniques are:

  • use of single letter variable names, which of course makes searching almost impossible, and even less the understanding of what they stand for;
  • creative miss-spelling: use correct spelling of a word in some place, and mis-spell it in other places, if possible, in different ways; that will definitelly confused many people;
  • be as abstract as possible, by naming functions like DoYourStuff, Execute, DoIt, RunIt, etc.;
  • use Hungarian notation as the ultimate “tactical nuclear weapon of source code obfuscation”;
  • use long similar variable names, that differ only in a letter or even only in the case;
  • pass all data as pointer to void and then typecast into the appropriate type;
  • comments on top of functions should be at least 15 lines long and use a lot of blank lines (I love this one)

The site shows a lot more techniques, and I encourage you to read them, not for using, but for avoiding them. Because the code should be readable in order to be maintainable.


Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.