Is using “base” bad practice even though it might be good for readability?

前端 未结 5 1616
野性不改
野性不改 2021-01-11 13:24

I know this is a subjective question, but I\'m always curious about best-practices in coding style. ReSharper 4.5 is giving me a warning for the keyword \"base\" before bas

5条回答
  •  清酒与你
    2021-01-11 13:53

    It's really a matter of personal preference. If you like seeing "base." at the beginning of your members, you can easily turn off the rule (Go to Options>Inspection Severity>Code Redundancies>Redundant 'base.' qualifier). Don't let non-behavioral static code analysis rules affect your preferred coding style.

    EDIT

    One thing to consider is that the static code analysis in FXCop and R# are there to provide rules for all possible needs. To actually adhere to all of the rules simultaneously is a little onerous. You should define your preferred coding style (if you're working in a team, do it collectively), and stick with it. Modify your rules to match your coding standards, not vice versa.

提交回复
热议问题