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

  • SEARCH
  • Home
  • 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 6186249
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T01:51:12+00:00 2026-05-24T01:51:12+00:00

The large majority of my programming knowledge is self-taught, so I was never taught

  • 0

The large majority of my programming knowledge is self-taught, so I was never taught proper design patterns, conventions, and so on and so forth.

I’ve been digging through a lot of my company’s software libraries lately, and I notice that a lot of class data members have underscores in their names.

For example:

class Image
{
// various things

// data members
char* _data;
ImageSettings* _imageSettings;
// (and so on...)
};

I see this in a lot of online example code as well. Is there a reason behind this convention? Sorry I couldn’t provide better examples, I’m really trying to remember off the top of my head, but I see it a lot.

I am aware of Hungarian notation, but I am trying to get a handle on all of the other conventions used for C++ OOP programming.

  • 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. Editorial Team
    Editorial Team
    2026-05-24T01:51:13+00:00Added an answer on May 24, 2026 at 1:51 am

    It is simply intended to make it clear what variables are members, and which are not. There is no deeper meaning. There is less possibility for confusion when implementing member functions, and you are able to chose more succinct names.

    void Class::SomeFunction() {
        int imageID;
        //...
        SetID(imageID + baseID); //wait, where did baseID come from?
    }
    

    Personally, I put the underscore at the end instead of the begining [if you accidently follow a leading underscore with a capital letter, your code becomes ill formed]. Some people put mBlah or m_Blah. Others do nothing at all, and explicitly use this->blah to indicate their member variables when confusion is possible. There is no global standard; just do what you want for private projects, and adhere to the existing practices elsewhere.

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

Sidebar

Related Questions

Large datasets, millions of records, need special programming to maintain speed in DBGrids. I
I have a rather large SQL query which the majority of which has come
The vast majority of a DirectByteBuffer - if large enough - is allocated off
I have a page with a large iframe that contains a majority of the
I'm working on a large Django app, the vast majority of which requires a
We have a fairly large code-base. The vast majority of the code is compiled
Large pages are available in Windows Server 2003 and Windows Vista . But how
Large complex make files can be daunting to read and examine. What tools are
A large international company deploys a new web and MOTO (Mail Order and Telephone
On large tables in MSSQL; selecting specific columns results in greater speed of the

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.