0

When I see some open source projects, specifically classes, I see that its variables starts with a 'm' minuscule. What does it mean? What means the 'm'?

  • It means "Member Variable". – Robert Harvey Apr 6 '15 at 2:07
  • 1
    It's a sort of Hungarian notation, most probably called so because it's equally easy to read. – maaartinus Apr 6 '15 at 2:24
  • @maaartinus Form your link "The original Hungarian notation, which would now be called Apps Hungarian, was invented by Charles Simonyi". Then clicking on Charles Simonyi you get "Charles Simonyi (Hungarian: Simonyi Károly, pronounced [ˈʃimoɲi ˈkaːroj]; born September 10, 1948), son of Károly Simonyi, is a Hungarian-American computer software executive who, as head of Microsoft's application software group, oversaw the creation of Microsoft's flagship Office suite of applications.". Its named after the nationality of its proponent. I would also point to the difference between apps and system. – user40980 Apr 6 '15 at 3:16
  • @MichaelT Sure, I wasn't serious about it. It also had a good justification in those times when there were just a few types to work with. Nowadays, I find the m or m_ variant just terrible, as you can simply write this.x = x instead of m_x = x. – maaartinus Apr 6 '15 at 3:33
  • @maaartinus at best, I think its an artifact of earlier days or people who refuse to use ctags and the like. I recall using it in my C++ programs back in college... but then, one didn't see colors on the screen when editing in vi (it was all amber or green depending on the terminal). Now, with an IDE, I can glance at an identifier and tell you most of its properties just by its color, bold, and italic nature. I don't need 'm_' giving me those hints anymore. – user40980 Apr 6 '15 at 3:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.