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

Hayley said:

Hi guys. Great page I will be a return visitor. Help me! Need information about: Airbrush tan supplies. I found only this - <a href="www.apreime.com/.../airbrush-tanning-instructions">airbrush tanning instructions</a>. Quite a painful equipments will create which working orange best days you, airbrush tanning. Some have called to make big spending and cosmetic painting scars, airbrush tanning. :-) Thanks in advance. Hayley from Colombia.

# March 25, 2010 4:20 AM
Leave a Comment

(required) 

(required) 

(optional)

(required)