M
Mike Hale
Is it better to use AndAlso and OrElse by default rather than the regual And
& Or?
MikeH
& Or?
MikeH
Is it better to use AndAlso and OrElse by default rather than the regual And
& Or?
* "Mike Hale said:Is it better to use AndAlso and OrElse by default rather than the regual And
& Or?
The effects are different.
I think MS would have liked to replace And / Or with AndAlso / OrElse, but
it would have broken many VB applications in the upgrade process. If a
programmer had done something like:
Boy was that helpful! Thanks! You really are an MVP!
I know that AndAlso/OrElse short circuits, checking from left to right,
which can be more efficient. Perhaps I should have worded my question "What
is more common among the VB developers out there..."
MikeH
* "Mike Hale said:Boy was that helpful! Thanks! You really are an MVP!
I know that AndAlso/OrElse short circuits, checking from left to
right,
which can be more efficient. Perhaps I should have worded my question "What
is more common among the VB developers out there..."
Tom Shelton said:The one I found especially anoying was the reversion to the VB.CLASSIC
way of declaring arrays... With the number in the () beign the last
index in the array rather then the number of elements in the array.
'Current and VB.CLASSIC method
Dim a(5) As Integer ' array with 6 elements 0 - 5
'Beta1 and, IMO, supperior method
Dim a(5) As Integer ' array with 5 elements 0 - 4
Of course, since I don't actually program in VB.NET (I do C#) - I
suppose I can live with it
I tend to agree with this too. When you are dynamically build an array, the first element is 0,
so to dimension an array with 1 element you have to use Redim a(0) which has always seemed
confusing to me.