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 #100182: Claculator

by jlahd
Cleanliness, simplicity and elegance are the four corner stones of the Claculator software design. Professors and instructors are encouraged to use this code as an example for students and trainees. The software also serves as an easy-to-understand introduction to Windows UI programming. For this reason, the names of variables, functions and classes are elaborate and clear. Also, note that there is no excuse for magic numbers or literals in code - always use a named constant!

Also, you can change values of all constants at runtime by adjusting values under the key HKEY_CURRENT_USER/Software/OMGWTF/Claculator. For example, to change the value of zero, create a binary value named "zero" under that key and set a four-byte long value to it. After this, all zeroes in the software use the new value.

Furthermore, I always recommend writing your own versions of the standard library functions. You never know who wrote the library functions, so there is no way you can fully trust the code. By writing your own functions, you have full control over the application and are also free to optimize style and performance to the fullest.

Download0 Comments