I found using AndAlso/OrElse, all the time, VERY annoying. It reduces code readability, especially when conditioning get complicated.
Any suggestions?
I found using AndAlso/OrElse, all the time, VERY annoying. It reduces code readability, especially when conditioning get complicated.
Any suggestions?
Are you saying that you don't like short-circuiting? Or you want the bitwise operators And
and Or
to short-circuit? Or you want the And
and Or
operators to be short-circtuiting logical operators for booleans and bitwise for integers?
I'm fairly sure there's no (supported) way to change the meaning of And
/Or
, and assuming that your code might in the future be maintained or read by other people it would be a very bad idea, you'd confuse them completely.
If conditioning gets too complicated I'd suggest instead splitting it up on multiple lines.
so instead of:
If x AndAlso y AndAlso (z Or w) Then
Make it something like:
xy = x AndAlso y
zw = z Or w
if xy AndAlso zw Then