Condividi tramite


Why did Visual Basic .NET introduce AndAlso and OrElse?

Posted by: Duncan Mackenzie, MSDN
This post applies to Visual Basic .NET 2002/2003/2005

Paul Vick, Technical Lead on VB.NET, and the author of the Visual Basic .NET Language Specification, discusses the new short-circuiting boolean operators added in Visual Basic .NET 2002.

Why did we introduce AndAlso and OrElse?

... Prior to VB.NET, the VB language only had the And and Or operators. They were essentially bitwise operators, which means that they took their two operands and performed an AND or OR operation on each bit position to produce the resulting bit...