- Feature Articles
- CodeSOD
-
Error'd
- Most Recent Articles
- Stop Poking Me!
- Operation Erred Successfully
- A Dark Turn
- Nothing Doing
- Home By Another Way
- Coast Star
- Forsooth
- Epic
- Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
Also, how about trapping all (including fatal) exceptions and instead return NULL's all the back to the front end which then attempts to use properties or methods on the null object. It's kinda the head-in-sand approach to exceptions. lemme tell ya, it's real fun to debug when all you know is a null object exception has occured, if you even get that much info.
Admin
actually, i'd say it's more like drinking a full bottle of slow acting poision, then reading the label...
Admin
Hahaha! <?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p>
I join you brothers in proclaiming myself both cooler and smarter than he is.<o:p></o:p>
What an affirmation of our existence to see with incontrovertible proof how much better than him we are.<o:p></o:p>
<o:p></o:p>
I ridicule, therefore I am! - Descartes<o:p></o:p>
Admin
A few quotes from the "Bad Code" page on Ward's Wiki:
The page also has examples of switch-case and many other common WTFs. reading through it can bring a strong man to tears.
Admin
Aggh! I meant 'for-case', not 'switch-case' (which is a valid construct, at least in C and it's descendants). The specific instance I had in mind was:
<font size="4">There is also the </font>EvilCode <font size="4">page, but that's different; those are examples of intentionally bad code.</font>
Admin
That's it? I'm looking at one at the company I work for having 40,000 lines in a single class.
Actually, that's not quite correct. They split out several other definition files for this class, which brings the true total up to just above 60,000.
Admin
Of course machine-generated code isn't a wtf, it is sane practice for usable code.
Admin
They've been studying...
Admin
Admin
Cripes. A thousand apologies for the double-post (I can't edit it/them, either).
Sometimes, I'm my own WTF.
Admin
I'm pretty sure that the entire code can be reduced to the following:
while(!IsListEmpty(List)) { process_notvalid_entry(); RemoveEntry(List); }
It hinges on the assumption that discoveredEntry is used to flag if an entry is present rather than to store the value of any of the function calls (which, looking at the names / likely side-effects is probably a whole other pile of junk.
Admin
I laughed--I cried--I did both at once. I'm scared. I'm shy. I don't know why. This should happen to a real guy. Aaaaaaaaaaai!
Admin
The assert false is like saying "fuck me, I can't code", but it's in a loop and not contained in an if/else, switch or anything conditional. Just bizarre. It never should have been a loop in the first place.