Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

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.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 124537
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T05:00:58+00:00 2026-05-11T05:00:58+00:00

Have read through the MSDN naming guidelines and could not find a clear answer,

  • 0

Have read through the MSDN naming guidelines and could not find a clear answer, other than that you should try to avoid underscores in general. Let’s say I have the following:

public class Employee {     private string m_name;  //to store property value called Name      public string Name     {         get { return m_name; }         set { m_name = value; }     }      public void ConvertNameToUpper()     {         //by convention should you use this         return m_name.ToUpper();          //or this         return Name.ToUpper();      } } 

What is the proper naming convention for m_name in the above? For example, in code I inherit I commonly see:

  • m_name
  • _name
  • name
  • myName or some other random identifier

Which one (or another) is most commonly accepted?

As a follow-up, in the methods of the class, do you refer to the internal (private) identifier or to the public property accessor?

  • 1 1 Answer
  • 2 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T05:00:58+00:00Added an answer on May 11, 2026 at 5:00 am

    I think that, whatever naming convention you use, the most important thing is that you stay consistent. I mean, if you choose to name private members like _name , then always do it like this instead of once using _name, and the other time m_name. I personally use the underscore-prefix convention. (one of the reasons is because I use NHibernate, and NHibernate has a ‘field.camelcase-underscore’ access strategy.

    For your other question: It depends on what you want to do.
    Does your property contain extra logic, and do you want this logic to be executed when you refer it ? Then use the property. You don’t want to execute the logic ? Use the field. Eric Lippert has written a post regarding this on his weblog.

    For your folluw-up: it all depends on the situation. If your property contains some additional logic, and you don’t want to execute that additional logic when accessed from within the class, then use the backing field …

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a kernel module that provides data to a userland process through read().
I have read through the documentation for Winsock2 on MSDN, but I still need
I have read through several reviews on Amazon and some books seem outdated. I
I have read through the solutions to similar problems, but they all seem to
I have a object built through a factory containing my parameters read from the
I have read a lot that LISP can redefine syntax on the fly, presumably
I have read that using database keys in a URL is a bad thing
I have read on Stack Overflow some people that have converting to C#2.0 to
I have read (or perhaps heard from a colleague) that in .NET, TransactionScope can
I just read through a 2002 article on MSDN called Calling a .NET Component

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.