-
Notifications
You must be signed in to change notification settings - Fork 245
Should convert "static readonly" field to Pascal style? #281
Comments
Yes |
But I see the "static readonly" fields is converted to camel style with '_' prefix: |
public static fields should be PascalCased. |
And I think "static readonly" should be PascalCased too instead of _camelCased in current behavior of the tool. |
I don't know what the current behavior of the tool is, but |
For rule "12: We use PascalCasing to name all our constant local variables and fields". |
No, there's a difference between consts and static readonlys, and we have different naming rules for them. |
@stephentoub as the style say it doesn't matter if you use or not to use an underline and whether it is public or not. |
@lindexi I'm not sure I follow.
This means the naming rules are:
The readonly-ness doesn't change the casing style or prefixes. While And we definitely wouldn't call |
You are right, the readonly doesn't influence the name style. An exception is that the private const field should be in PascalCased: |
@AllenLius But I think the |
|
A subtle difference, but a difference nonetheless. |
A "static readonly" field more like a const field that can be changed only in static ctor.
The text was updated successfully, but these errors were encountered: