What is the universally accepted naming convention for c#?
(functions, classes, parameters, local variables, namespaces, etc)
What is the universally accepted naming convention for c#? (functions, classes, parameters, local variables,
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Microsoft has an excellent set of guidelines on class library design, including a section on naming. In short (examples in parentheses):
WebRequest)IDisposable)ToUpper)Length)Click)System.Collections; unusual to have two words in one part though)keySelector)Int32.MaxValue)HttpStatusCode,BindingFlags)ThreadStaticAttribute)Private names are up to you, but I tend to follow the same conventions as for everything else. Hungarian notation (in the style of Win32) is discouraged, although many places use “m_” or “_” as a prefix for instance variables.