0

Well, today, I had an intense discussion with one of my colleagues about underscores in attributes' names. While some libraries I work with put it in the start of the name, others put it last.

Is the recommended standard to put it first, and if so, why do others like PCL library put it last?

Also, Is there a special shortcut in msvc to suggest only underscored variables?

namu
  • 205
  • 2
  • 8
Vtik
  • 3,073
  • 2
  • 23
  • 38
  • You could make aliases using `#define`s. – Top Sekret May 12 '16 at 20:43
  • 3
    Leading underscores are reserved in the global namespace. So to avoid confusion and bad habits, avoid them also for class member names. Code with leading underscores in names, other than C++ implementation code, generally communicates "this was coded up by a novice, or an incompetent" (but I've used it sometimes for function arguments, there's no good convention for that so choosing lesser evil). – Cheers and hth. - Alf May 12 '16 at 20:46
  • 2
    A more general question has been discussed in great detail: http://stackoverflow.com/questions/228783/what-are-the-rules-about-using-an-underscore-in-a-c-identifier – gdlmx May 12 '16 at 20:49
  • 2
    Are you asking "Do I put underscores at the start or end of attributes' names?" If so, then why are you convinced you need to do either of those? – user253751 May 12 '16 at 20:51

0 Answers0