-1

I am curious to know, is there a convention to the usage of this-> in C++? I generally like to use this-> to emphasize that a method and/or variable is a member of the containing class, but it does look rather unappealing, visually speaking. It'd also be awesome to know about any other C++ coding conventions often seen in industry, e.g. Camel case vs. underscores, etc.

Thanks!

John Ruffer
  • 47
  • 1
  • 6
  • No one cares as long as you're consistent. If people do care then they need to stop caring. Also, unfortunately this question is not suited for [so]. Consider reading the [faq](http://stackoverflow.com/faq) – Rapptz Mar 26 '13 at 21:36
  • Could you elaborate as to how this question is not suitable for StackOverflow? – John Ruffer Mar 27 '13 at 00:42

1 Answers1

0

I am curious to know, is there a convention to the usage of this-> in C++?

I personally avoid the this-> pointer whenever possible but that's just personal preference.

It'd also be awesome to know about any other C++ coding conventions often seen in industry, e.g. Camel case vs. underscores, etc.

Coding conventions largely vary but one example is Google's comprehensive C++ Style guide.

And, my favorite:

Melroy van den Berg
  • 2,697
  • 28
  • 31
sgryzko
  • 2,397
  • 2
  • 22
  • 37
  • 1
    The Google C++ style guide doesn't seem to mention anything about the `this` pointer. – Bugalugs Nash Sep 21 '14 at 03:01
  • @BugalugsNash I didn't mean to imply that it did. I just referred to the Google style guide to answer the second part of the question. I've edited my answer to hopefully make that more clear. – sgryzko Sep 22 '14 at 15:23