The ultimate guide to unmaintainable code...

Wednesday, November 23, 2005

Hello everyone!!! And to my programming friends i have a special treat!! How to make a unmaintainable program and torture future generations!! Here is a sneek preview...
  • New Uses For Names For Baby: Buy a copy of a baby naming book and you'll never be at a loss for variable names. Fred is a wonderful name, and easy to type.
  • Single Letter Variable Names: If you call your variables a, b, c, then it will be impossible to search for instances of them using a simple text editor. If anyone even hints at breaking the tradition honoured since FØRTRAN of using i, j, and k for indexing variables, namely replacing them with ii, jj and kk, warn them about what the Spanish Inquisition did to heretics (NOBODY EXPECTS THE SPANISH INQUISITION!! *confused? two words for you my friend... Monty Python*).
  • A.C.R.O.N.Y.M.S.: Real men never define acronyms; they understand them genetically.
  • Use Plural Forms From Other Languages: Esperanto , Klingon and Hobbitese qualify as languages for these purposes.
  • Underscore, a Friend Indeed: Use _ and __ as identifiers.
  • Mix Languages: Randomly intersperse two languages (human or computer). If your boss insists you use his language, tell him you can organise your thoughts better in your own language, or, if that does not work, allege linguistic discrimination and threaten to sue your employers for a vast sum.
  • 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.
  • Obscure film references: Use constant names like LancelotsFavouriteColour instead of blue and assign it hex value of $0204FB. Only someone intimately familiar with Monty Python and the Holy Grail would know that Lancelot's favorite color was blue. If a maintenance programmer can't quote entire Monty Python movies from memory, he or she has no business being a programmer.
  • Be polite, Never Assert: Avoid the assert() mechanism, because it could turn a three-day debug fest into a ten minute one.
  • Use Three Dimensional Arrays: Lots of them. Move data between the arrays in convoluted ways, say, filling the columns in arrayB with the rows from arrayA. Doing it with an offset of 1, for no apparent reason, is a nice touch. Makes the maintenance programmer nervous.

And i can go on... if you are interested in reading all the document... check out... http://thc.org/root/phun/unmaintain.html its really funny... in a geeky / programmer way...

6 people said...:

Tu padre said...

con razón no me corren los programas...

sgenius said...

Sea bárbara compañera...
...espero que nunca me toque debuguear un programa suyo =P jaja!

Tu padre said...

Neta que no.... aunque aun no conozco a alguien que haya seguido todo esto al pie de la letra.... chale!

Aunque creo que el ingeniero Onijete si programa así...

sgenius said...

/* una de mis típicas funciones en C */
int* mom(int i, int &I){
return((*++i)+--&I+(int)(i||I++));
}

Emily said...

Sea barbaro... Fer tienes problemas... SEVEROS problemas...

twisted faerie said...

jajaja...me recuerda a mis primeros programas: las variables agh, egh, blegh, blagh, blah, boo, eek, wee, woo, etc etc nunca faltaban :P