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
  • 0 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

Ask A Question

Stats

  • Questions 78k
  • Answers 78k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • added an answer That's because <? is the short opening tag for php.… May 11, 2026 at 3:51 pm
  • added an answer array($stmt, 'bindparams') is PHP's way of identifying method bind_params on… May 11, 2026 at 3:51 pm
  • added an answer Yes, $tempParams = $params; Will copy all values from $params… May 11, 2026 at 3:51 pm

Related Questions

Is anyone aware of a good resource online for detailed information on the use
I'm trying to find out how much memory my own .Net server process is
What's a better way to start a thread, _beginthread , _beginthreadx or CreateThread ?
I have a requirement in my application that I think can be met by

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.