Skip to content

Moronic beyond belief

That’s me, in case you didn’t already know. While a lifetime of evidence exists, in the interests of brevity, I will only present its latest manifestation. Warning: this is a work-related (read: geeky) rant.

if ( A or B ) // A and B are some valid conditions
{
if ( A ) return x; // x is some valid return value
if ( B ) return y; // y is some valid return value
throw error; // should never reach here, right?
}

There should be absolutely no reason I’d get the error. Yet, I was. And once I got the error, I praised myself for having kept an “open mind” and actually anticipating that the impossible could happen. I enchanted myself with the discovery I was about to make which allowed this execution flow and rewarded myself with a subway cookie.

A while later, after banging my head around trying the complex conditions A and B by hand, I realized that it was impossible for this impossible thing to happen – as any first year undergrad could tell you. I’m doing a PhD and have to keep an open mind and let my brains leak out. That’s my excuse.

What happened was pretty simple. Master Yoda would put it this way: “Putting way too many error messages leads to lost time. Lost time leads to hurrying up your code. Hurrying up your code leads to copying and pasting aforementioned error messages. That leads to confusion about which error message you’re seeing. Confusion leads to suffering. Mmmm?” I sure found that out, after trying for an hour to debug code that was completely and obviously correct.

After this episode, which was actually the least of my worries (ever heard of segmentation faults?), I was wondering why it felt like I’d gone around in a circle a hundred or so times. And that’s when the universe, in a cruel stroke of brilliance, responded through subversion:

$ svn commit
Committed revision 314.

Just one of those days.

One Comment

  1. Soham wrote:

    Tres bien mon ami…..forgotten to commit u had…..

    Tuesday, September 11, 2007 at 8:32 am | Permalink

Post a Comment

Your email is never published nor shared.