Conformity with other languages, OrElse
Posted
Mon, Apr 24 2006 6:29
by
bill
I was just reading another one of
Billy's blog entries, but this time I really have to disagree:
Billy said : " At first, VB was to be brought into conformity with other languages on how AND and OR clauses are handled in If statements. That is, given the condition "x AND y", then if x is False, it's not necessary to evaluate y."
That's not actually correct. Other languages, at least of the C family have two distinct set of operators, & and |, and && and ||. The first two evaluating both operands, the second two providing short circuiting.
So the language equivalents are:
And -> &
Or -> |
AndAlso -> &&
OrElse -> ||
So you can see in both languages the short circuited operators are actually double words. Hopefully that ends the fallacy of the flux being to do with conformity with other languages. It never was.