In VB.net the ANDALSO and ORELSE keywords should basically always be prefered over the AND and OR keywords.
What is the easiest way to disable the AND and OR keywords?
I’m thinking FXCop (maybe somebody has already written this rule).
Maybe just some setting in VS (we’re currently using 2008 and are moving to 2010 end of the summer)
I’m open for all suggestions.
Hehe, I think the solution you are looking for is called C#.
But seriously, using VB, you could go with some kind of blanket policy enforcement using FXCop or similar code analysis tools.
But when it comes to such a basic and fundamental feature as the language’s core logic operators, you probably shouldn’t mess with them even through policy enforcement. This is a training issue, and would be best addressed by training.
Detecting the accidental mis-use or unintentional use of these operators is best handled via unit testing or peer review. Basic operator behaviors are Chapter 1 stuff in any beginner’s guide to VB, and no programmer should be working on real production code if they haven’t mastered the basic syntax and operators of the language yet.