banner
Dave Horner's Website - Yet another perspective on things...
Home Tech Talk Programming Visual Basic - Imports Daves.VB.thoughts.
If you appreciate the information found on this website, please drop me a line!

Who's Online

We have 31 guests online
Content View Hits : 1157215
moon and stars
How did you find my site?
 
How often do you answer random online questions?
 

Random Quote

I have discovered a truly remarkable proof which this margin is too small to contain. -- Pierre de Fermat
P1010005
P1010012
100_1770
P1010003

Visual Basic - Imports Daves.VB.thoughts.

Thursday, 15 October 2009 23:36
Visual Basic is a fine language. I've written applications in VB6 and VB.net. VB isn't my cup of tea when I think about syntax....but it does accomplish the job.

I would like to add that I do appreciate the xml literals they added to VB. This is actually a very cool addition.

There are some things to be aware of though...

Short-circuit in VB

VB does not evaluate a logical AND like other languages you might be used to. If the first term evaluates to false, it will still try and evaluate the rest of the terms...instead of just continuing on...
Description of "short-circuit" evaluation in Visual Basic


Default nullable type in VB

If you want to have an optional boolean value...you'd think you could use nullable type.
Function SomeFunc(Optional ByRef someFlag As Nullable(Of Boolean) = Nothing)
But VB will give you the error: Optional parameters cannot have structure types.
UGH! Instead, you might try the TriState Enumeration...which does work.
Function SomeFunc(Optional ByRef someFlag As TriState = TriState.UseDefault)


Last Updated on Thursday, 15 October 2009 23:39