C.1. General naming conventions
The casing conventions for C# are shown in Table C.2
Category | Casing |
---|---|
Local variables | Camel casing |
Parameters passed into methods (considered local variables) | Camel casing |
All other identifiers (names of namespaces, classes, interfaces, all class members) | Pascal casing |
This implies that your method and field names should use Pascal casing, like your classes. In C#, camel casing should be reserved only for local variables. [2]
[2] This is very different from Java's naming conventions. Java advocates that all class and interface identifiers should use Pascal casing, and all other identifiers use camel casing. C# says that all identifiers should use Pascal casing, except for local variables ...
Get From Java to C#: A Developer's Guide now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.