codeformatter icon indicating copy to clipboard operation
codeformatter copied to clipboard

"m_" fields should be renamed regardless of visibility

Open stephentoub opened this issue 10 years ago • 3 comments

Some code bases use the "m_" prefix for internal fields. These should be renamed as with private fields.

stephentoub avatar Jan 10 '15 12:01 stephentoub

indeed they should. However, it might cause a breaking change. You would have to ensure that the code still compiles after changing something. I'd recommend to produce a warning rather than an automatic change.

MovGP0 avatar Feb 16 '15 07:02 MovGP0

I'm not sure this is a good idea assuming that we have InternalsVisibleTo.

krwq avatar Feb 23 '15 19:02 krwq

Assuming that the reformatting happens at a solution-wide scale, the InternalsVisibleToAttribute shouldn't be a problem. But that is not guaranteed.

Reformatting of public and internal names is always a problem. When Reflection is involved, even renaming of private objects might cause problems.

I think it would be a good idea to implement such a feature. By default it should only cause a warning, and when enabled it should reformat. So an opt-in approach rather than an opt-out.

MovGP0 avatar Feb 24 '15 03:02 MovGP0