I’m a regular reader of The Daily WTF and most of the time I get a good laugh and think to myself “Boy, I’m glad I’m not working on that system.”
Then I get to work and find myself looking at very similar instances of WTFness in the applications I am working on. I think that the level of WTFness in the industry at the moment is sufficiently high enough to make it difficult for a Daily WTF site to cover all the cases. So, while remaining an avid fan and subscriber of the site, I’ve decided to start posting my own WTFs that I’ve seen along the way, with obfuscation and code changes to protect the …er… guilty. This may become a fairly regular posting category for me.
What I will say before posting my first example is that there might be some cases where the WTFness isn’t immediately obvious, or the point of the WTF is so small it might be considered “nit-picking”. All I can say to that is: if I think it’s a WTF I’m going to post it
Feel free to comment if you feel like it.
So, today I’m going to start with a couple of files that I’ve stumbled across which contain an insane amount of code. Bear in mind that this system contains a lot of files - there are a lot more files that fit into this category.

Yup, that’s just 3 files. One of them is the code-behind for a web user control (ascx.cs) which contains a 1.5k line Page_PreRender() function.
WTFness: 8 / 10.
Edit: I just thought I’d let you know that these code files are not generated. They’ve all been hand-coded!











November 7, 2006
I made a user control that extended a drop down list - added a “Go” button to the right. Was about that many lines….what’s the problem here?
November 8, 2006
Sounds like years old code that’s been incrementally added to without a major refactor. A very common WTF - which isn’t really a WTF, cos there’s perfectly decent explanation and it’s not cos one bloke did something that makes you think “WTF???”
November 8, 2006
I disagree. Files this big indicate bad code design/structure. They are unmanagable and noone wants to go near them.
That is definitely at WTF as far as I’m concerned.
November 8, 2006
All it shows is that the requirements now weren’t seen when the file was originally written (before it got added to time and time again). Whether the original requirements gathering was good or bad I can’t tell. The WTF is that it wasn’t refactored along the way somewhere.
November 8, 2006
Lack of requirements is no excuse for being too lazy to refactor. And yes you’re correct, the WTF is that the code hasn’t been refactored, that makes this a valid WTF.
In my opinion, the extra WTF in this case is that the programmer responsible for this travesty doesn’t see anything wrong with it.
November 8, 2006
This is a definite WTF as I think the files you are describing have repetitive code in them. Hello? Ever heard of variables?