Your Daily Cup of WTF - IsTrue()

Yesterday, we learned that sarcasm is officially dead. Oy. So today, let me disclaim by saying that I am not actually advocating this as a good practice. Just trying to toss in a little humor. And also, let me applogize already for having a weak example today, been too busy to dig for some real gems. And with out further ado, your Daily Cup of WTF:

Now I for one can't seem to fathom why the folks at Microsoft that engineered the framework did not think to include this as a core function. Honestly, how else are you supposed to know if an expression is true or false. See how ambiguous and confusing this is:

If myDocument.IsActive Then DoStuff()

I'm completely lost. WTF does that line of code do? Now lets see how it looks when we employ best practices and the the IsTrue function:

If IsTrue( objInstanceOfDocument.blnDocumentPropertyIsActive ) Then fn_DoStuff()

Crystal. Clarity.

Some more ado ... Fellow blogger brady gaster suggested I start a separate blog where we all submit ideas. I did the first step, and registered Any ideas on a good way to configure .TEXT for it?


  • Well apparently whoever coded that function didn't think it through and forgot to include IsNotTrue, because how exactly are we supposed to tell when an expression is not true?

  • I did think about create the IsSomething function just because I was sick if writing Not IsNothing. But then I had a beer and everything was cool.


    i'll help. got a host for the puppy yet?

  • Your "Daily dose of WTF?" has been the highlight of my last couple of weeks!

    Hey, I wrote an IsSomething function in VB6--of course, I was training a beginner at the time, and "IF Not SomeObject Is Nothing then" doesn't really make a lot of sense :)


Comments have been disabled for this content.