A
Alfred Taylor
I've been flipping through various coding standards documents for C#/.NET
and all of them say to use:
if ( boolVar ) {...} instead of if ( boolVar == true ) {...}
For the life of my I can't figure out why. If anything, I would guess the
opposite would be better to use since the ! operator is so hard to read.
Upon quick glance,
if ( boolVar == false ) is easier to understand than if ( !boolVar )
Anybody have some more concrete reasons why one is preferred over the other
aside from one being less typing.
Thanks,
-A
and all of them say to use:
if ( boolVar ) {...} instead of if ( boolVar == true ) {...}
For the life of my I can't figure out why. If anything, I would guess the
opposite would be better to use since the ! operator is so hard to read.
Upon quick glance,
if ( boolVar == false ) is easier to understand than if ( !boolVar )
Anybody have some more concrete reasons why one is preferred over the other
aside from one being less typing.
Thanks,
-A