About The Contest
The first ever Olympiad of Misguided Geeks contest at Worse Than Failure (or OMGWTF for short) is a new kind of programming contest. Readers are invited to be creative with devising a calculator with the craziest code they can write. One lucky and potentially insane winner will get either a brand new MacBook Pro or comparable Sony VAIO laptop.
Entry #100206: Rube Goldberg's Calculator
by Charles Nadolski
Hello, and thank you for accepting my submission to the OMGWTF.
I've decided to not implement many "groin kick" WTFs (like trying to create my own string library),
as we've seen tons of those in the Code SOD's. Instead, I have created a "Rube Goldberg" calculator,
with a wide variety of smaller WTF's sprinkled here and there. It's a compilation of mostly big picture wtf's,
a.k.a. anti-patterns. Premature Optimization, Not-Invented-Here, Copy and paste programming
(thankfully not a lot of that), Golden hammer, Reinventing the square wheel, etc. I sprinkled some
WTFworthy comments too. Enjoy!
Some of the features of this project:
-Caching of final values in xml for "faster" access later.
-Pointless use of inline assembly. I hope the test machine has SSE2 instructions available.
-Conversion of floats to fractions for "faster" and "more accurate" results
-Abuse of bitfield types.
-Storing positive and negative as enumerations... DivideByZero is the equivalent of FILE_NOT_FOUND
-A homegrown XML parser.
None really needed. Open the solution, compile, and run.
--Charles Nadolski, C# programmer
PS: Be sure to look for a file called ResultCache.xml when you're done running the tests, hee hee.