Mr. Bad Example

We're all examples: some good, some bad, some ugly.

Forget IsNot, I want IsSomething

On my current main project, I'm stuck writing a lot of code like:

if not(x is nothing) then

Yes, it's VB.NET. And, no, I don't have choices.

You know what I really want?  A function that looks at a object of any type and if its Nothing, dbNull.Value or String.Empty, return False, otherwise, return True.

At least

if IsSomething(x) then

would be less boring to write over and over and over again.

And no, I'm not in the mood to argue semantics about what nothing really means, either... unless you are Kiri-kin-Tha.

Comments

No Comments

Leave a Comment

(required) 

(required) 

(optional)

(required)