When writing an If statement, I've always used And
when needed like:
If 1=1 And 2=2 Then
The only time I ever used AndAlso
is if the second condition will error if the first isnt true like:
If Not IsDbNull(Value) AndAlso Value=2 Then
However, recently I've heard that AndAlso
is better for performance than And
as the second condition is only read when the first is true.
In this case, should I always just use AndAlso
?