New rule: DoNotWrapPublicInterfaceIntoConditionalBlock

Apr 10, 2011 at 5:32 AM

This rule may be more FxCop-ish.

Do not wrap parts of class public interface into #if DEBUG block.


public class Item
    int GetLength();
This will generate different code for debug and retail builds and may introduce tricky issues.

Apr 12, 2011 at 3:34 PM

Lets see what everyone else thinks. Maybe this is a common pattern that people do actually need. Thoughts everyone please?

Apr 13, 2011 at 7:40 AM

In my opinion, the rule is

  • fuzzy (there could be any preprocessor directive)
  • uncommon (never saw anything like that)
  • doesn't relate to style

Best regards,
Oleg Shuruev

Apr 14, 2011 at 12:31 AM

I don't think this has anything to do with style.