Wednesday, July 20, 2005

How to write unmaintainable code!

I was reading an article on "How to write unmaintainable code!". The article was really well-written and extensive, touching on almost all aspects of making the code as confusing and ambiguous as possible, making use of the simplest as well as the most complex nuances available in the language and programming constructs supported there.

Well, but you know what, I have seen really badly written code, written by someone who has not tried to write "unmaintainable code"; in fact, the person was trying to write good, maintainable code! Some people do have a natural flair for writing unmaintainable code. We could add on several additional points to the article, by going through their code. Though it is worse than a nightmare for the person trying to maintain the code, or for someone trying to debug the code..., writing such code is real fun, especially when we make use of the subtle specialties provided by that specific language.

If some people do this for fun or for showing off their "flair" in programming, some people do this for sheer pleasure of letting out their frustration at having to spend their precious time documenting stuff - there are several ways for such people to have their share of fun - "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" - this being one of the many ways to help release the frustration of a coder who feels he is wasting his time in documentation.

I believe that writing unmaintainable code is a skill (some have it inborn... ;)) and people should have their share of fun doing this! God save the maintainers, though (hope I do not belong to this category of people) !

No comments: