Disable AND and OR keywords

In VB.net, keywords ANDALSO

and ORELSE

should mostly always be preferred over keywords AND

and OR

.
What's the simplest way to turn off the AND and OR keywords?
I think FXCop (maybe someone already wrote this rule).
Maybe just some tweaks in VS (we are currently using 2008 and moving towards the end of summer summer)

I am open to all suggestions.

+2


a source to share


2 answers


Hehe, I think the solution you are looking for is called C #.

But seriously, using VB, you can go with some kind of defensive political action using FXCop or similar code analysis tools.



But when it comes to something as basic and fundamental as the core language logic statements, you probably shouldn't mess with them even through policy enforcement. This is a learning problem and is best addressed through learning.

The detection of accidental misuse or inadvertent use of these operators is best handled through unit testing or peer review. Basic operator behavior is the material in Chapter 1 in any VB beginner's guide, and no programmer should work on real production code unless they have already mastered the basic syntax and operators of the language.

+1


a source


In keywords And

and Or

other functions are used, except just logical operations. Bitwise operations are performed using these keywords, so unless you can be absolutely certain that you will never need to perform bitwise operations, you do not want to disable these keywords.



0


a source







All Articles