Capitalization in C# / Unity is an infuriating minefield.

Microsoft and Unity offer slightly different standards and then don't consistently follow them.

There is no entry for "capitalization" in the index for the 1000-page C# 10 in a Nutshell. There is some advice under "identifiers", but it differs from what is given by the previous two sources.

Many sources want to capitalize private and public fields differently. Why would you do that?!

Unity adds spaces and changes the capitalization when displaying class and field names.

If you refactor a name, Unity bloats your code with a FormerlySerializedAs attribute.

Follow

People generally seem to agree that C# class names should be PascalCase.

Except for, y'know, the class you'll probably use most often: string.

Sign in to participate in the conversation
CleverLibre Social

CleverLibre Social is an inclusive social instance for open discussion, learning, and community.
All cultures welcome.
Hate speech and harassment strictly forbidden.