Most programmers probably already know this, but I have observed that for beginner programmers, it is quite frequently unknown or overlooked. When you evaluate expressions you need not evaluate "If <expression> = true then", you simply evaluate "If <expression> then" This is because <expression> already produces a Boolean value, and an if then branch breaks down to the following logic:
1.
If
<Expression> then
2.
'True was the case
3.
Else
4.
'False was the case
5.
End
(1+2=4) = true then
<
Boolean
> = true then
> then
(((((1 + 2) = 3) =
True
) =
)
Then
Absolute WebCounter
Naomi N edited Revision 1. Comment: Minor edit
Hi Paul, I think it will be nice if you add more into this article about short-cutting and various ways of writing if and logic in VB.NET (I think there is a syntax, but I always forgot exact details). If you also add a bit of the similar for C# (e.g. how to short cut IF logic) then it will be great. It may be not the exact topic of this article, but something I often need and when I need it, I do an extra research every time