If you’ve never done any programming whatsoever in an imperative language such as Java, C, C++, and the like, this post will likely make very little sense and will not be funny in the least. I assure you, humor is intended.
An online friend of mine, Sean Paul-Rees, came up with this coding gem:
He made an interesting point — “doom” is a very subjective thing. Now, the way I see it, since doom is necessarily boolean according to its format in the if statement, you could select doom based on a switch statement on a specific constant value.
However, doom is subjective, so such a structure is relatively impractical. Nested if/else statements would seem to be the key, since we’re looking for particular conditions.
Now, what conditions do we test…? Well, we’d have to assume a specific definition for what “doom” means before we started defining the code. Do we see doom as something akin to Armageddon (in which case testing is extremely complex) or simpler (in which case testing is still extremely complex)? I suppose it depends on your political slant, religious beliefs, and whether you think simple things can be equated with doom. The example Sean gives is that simply doing homework can be attributed as doom, but my reply to that is that it depends on what you’re doing in life — not everyone does homework all the time, every moment in their lives…
An aside: for those wondering, Sean points out that the coding of the chaos() function is easy in a UNIX/Linux environment; just delink /dev/null. My two cents — it’s even easier in a Windows environment (I’ll leave the question of how to your imaginations).