문제

I found using AndAlso/OrElse, all the time, VERY annoying. It reduces code readability, especially when conditioning get complicated.

Any suggestions?

도움이 되었습니까?

해결책

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
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top