Friday, October 06, 2006

 

I Hate Programmers, Part 2

So, I'm reviewing a source file, and I run across this:

  CreateXML(false,false,true,true,true, false, true);

Wondering what the arguments meant, I tried a search:

SomeClass.cpp(2017):  CreateXML(false,false,true,true,true, false, true);
SomeClass.cpp(2135):  CreateXML(false,true,true,false,false, false, false);
SomeClass.cpp(2254):  CreateXML(false,false,true,false,false, false, false);
SomeClass.cpp(2334):  CreateXML(false,false,false,true,false, false, false);
SomeClass.cpp(2413):  CreateXML(true,false,false,true,false, true, false); 
SomeClass.cpp(2492):  CreateXML(false,false,false,false,true, false, false);
SomeClass.cpp(2572):  CreateXML(true,false,false,true,false, false, false);

I am especially amused by the fact that the last two arguments on each call have spaces before them. The difference in style suggests a different author. It means that somebody thought it would be a good idea to add two more mysterious boolean arguments to a function that already had five mysterious boolean arguments.

It was no surprise to find that the CreateXML function was a few hundred lines long. It contains 39 if statements. I'm sure the authors were proud of the powerful function they'd created.


Comments:
All those calls to this function with all the parameters hard coded?

WTF?
 
May I suggest you submit this to http://thedailywtf.com/
 
Post a Comment

<< Home

This page is powered by Blogger. Isn't yours?