Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[C#] Use pascal casing with C# public (static) fields #4739

Open
MihaMarkic opened this issue Dec 1, 2024 · 0 comments
Open

[C#] Use pascal casing with C# public (static) fields #4739

MihaMarkic opened this issue Dec 1, 2024 · 0 comments

Comments

@MihaMarkic
Copy link

With C# generated code public (static) fields should be pascal cased, not camel cased. An example is lexer generated code:

public static string[] modeNames = { ... }

should be

public static string[] ModeNames = { ... }

But then there is a virtual function ModeNames which complicates it. Perhaps modeNames should be a part of the constructor instead as there is no use of it as a virtual function (which also slows down execution) - or perhaps there is an use to override it?

Excerpt from C# identifier naming rules and conventions
When naming public members of types, such as fields, properties, events, use pascal casing. Also, use pascal casing for all methods and local functions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant