The Olympiad of Misguided Geeks at Worse Than Failure Programming Contest was not easy to judge. With their use of OCR, Extreme Hardware Virtualization, and Fractions for math, each finalist represented a very unique and a very wrong way of implementing a simple calculator. We truly believed that each finalist deserved to win, but as Connor MacLeod would say, “there can be only one [OMGWTF Winner].”

To make the determination, we asked our panel of judges (Raymond Chen, Joel Spolsky, and Jeremy Zawodny) to decide. “I’m impressed by all the work people put into this,” wrote Joel, “I guess it’s possible to take pride in just about anything, which explains how some of the code I’ve seen got written in the first place.”

But before I reveal what the judges picked, here are the runners-up.

Readers’ Choice: Entry #100175 (Ivan Milyakov's OMG!OCRCAL)

With nearly 30% of the vote (and that’s after filtering for duplicates, such as Mr.’s 183 votes) the OMG!OCRCAL was clearly the readers’ choice. And how couldn’t it be with an English-based configuration file and a horrid OCR-based input? The judges, however, passed. Raymond said it best, in that the OMG!OCRCAL “went for absurd creativity … I mean, sure, Ugly Betty is ugly, but it’s not like she’s a Cyclops with a horn growing out of her forehead.”


Editor’s Pick: Entry #100206 (Charles Nadolski’s Rube Goldberg’s Calculator)

Jake, Intern Boyd, and I felt that this entry captured the purest spirit of the contest: the right result in the wrong way with code that’s production quality but yet should ever have been produced. As Raymond Chen put it, “XML is the wave of the future. It's the standard for data interchange. Anybody who doesn't get that is an idiot. And, of course, when you find the inner loop of your program, you optimize it for performance. Another basic lesson from Don't Be An Idiot 101. Put ingredients in a bag, shake, serve.”


Editor’s Pick: Entry #100252 (Greg D’s Universal Calculator)

The Universal Calculator was the second most popular (with over 15% of the vote), and for good reason: it spoofed a framework/application that tries to be everything to everyone and pretty much fails miserably to be anything but a waste of time. And the fact that it was built piecemeal with no planning and very little testing added to the somewhat realistic grossly inefficient design.


The OMGWTF Winner: Entry #1000043 (Stephen Oberholtzer’s Buggy 4-Function Calculator)

Both Raymond and Joel picked the Buggy 4-Function Calculator as their top pick. “I can see somebody actually writing this pile of junk with a straight face,” commented Raymond, “specifically the ‘inventing our own number format’ part.”

“This is not just bad code,” added Joel, “this is *believable* bad code, which to me reflects the true spirit of The Daily WTF… and best exemplifies what real-world code looks like.”

As an interesting aside, Raymond mentioned that a custom numeric format isn’t too outrageous, “after all, the Windows calculator itself uses a nonstandard numeric format in order to produce its exact results.” He added that, “if you choose to go this route, you have to be confident that you can get it right. Especially if you're going to use it in a calculator.”


The Almost Runner-Ups

The judges also had some other favorites as well.

“The idea of inventing a whole new concept,” Joel commented on Entry #100123 (Dave C.'s WTF Web Calc), “of shipping Windows programs in the form of web clients with their own custom web server, just because you can't be bothered to learn about GUI programming, has an honorable history (Radio UserLand).”

Joel also appreciated Entry #100099 (Keith Lucas’s estimator), “because the string comparison code for ‘value’ cracked me up; I've definitely written code like that, and I HAD A REALLY GOOD REASON, but I just can't remember what it was.”

“This is another program that I can imagine somebody actually writing with a straight face, specifically the ‘play user input actions to a copy of Calc and then try to suck the answer back out’ part,” Raymond wrote of Entry #100066 (Dan U’s FileSystemHashMapNotepadCalculator), “No wait, I don't have to imagine it. I've actually seen it happen! (see The Intimate Parasite of Sound Recorder)”

“It’s pretty common to see something that should have been a simple state machine, or a loop with a switch statement proliferate into dozens of C++ classes representing ‘states,’ each in their own pair of .CPP/.H files, completely impossible to debug or see in one place, “Joel said about “clever” solutions in general, “nobody told these people that pure OO design isn’t always the best way to write a given piece of code.”


Wrapping Things Up

I hope you enjoyed reading about and participating in this contest. We all had a lot of fun putting it together and certainly couldn’t have done it without your support and, of course, Coverity’s gracious sponsorship. We’ll continue to update the OMGWTF contest site with minor updates and results from Coverity’s Prevent  (see the latest post about the finalists’ scan results). And, of course, there’s also the 250+ valid entries that you can check out and comment on. Enjoy!

[Advertisement] BuildMaster allows you to create a self-service release management platform that allows different teams to manage their applications. Explore how!