Search code examples
c#conventionscasing

Should I really Pascal case almost all public identifiers in C#?


I'm coming to C# from java. Java has a set of conventions that make it easy to see the use of an identifier by its casing.

Reading up on the Microsoft conventions it seems like they want you to Pascal case almost everything except parameters. It seems to me this is a much less information rich convention.

Is it really considered bad form in the .NET/Mono world to break this convention and do I just need to get used to it, or can I carry my Java habits over to my C# code that others are going to use?


Solution

  • Well, ultimately it depends on you what you choose. If others are ok with the Java style of naming, you can use it, but I would probably stick to pascal case at least for public members your classes to be consistent with the rest of the language.

    ReSharper offers quick way to convert naming conventions be reformatting code, so you might also try to use your learnt ways for new classes and let it perform it's magic before you check in the code for others to see :-) .