Good C++ practices

Pages: 1234
OK, so at a point a person will not find anything new or interesting to learn in C++ but its quite helpful and worth the effort to adopt good C++ coding practices. There are many who don't know these, including myself. Therefore, I ask that if you know any, please list them. :)
I would start with Sutter/Alexandrescu's book "C++ Coding Standards" , although it doesn't go into too much detail.

And stay away from Google style guide if you want to be taken seriously.
There is a list of good ones at http://isocpp.org/wiki/faq/coding-standards . In fact, the whole FAQ could be shown as a 'Good Practices' guide, and goes in-depth with common questions and problems with C++ - I'd highly recommend that people take a look.
Cubbi wrote:
And stay away from Google style guide if you want to be taken seriously.

What's interesting is that a few of their guidelines are in line with those given by the FQA.
"Don't use exceptions."
"Avoid initialization in constructors / use initialization member functions."

There are also some weird ones.
"Don't use lambdas."
"Don't use streams."
closed account (z05DSL3A)
CERT C++ Secure Coding Standard:
https://www.securecoding.cert.org/confluence/pages/viewpage.action?pageId=637
What's interesting is that a few of their guidelines are in line with those given by the FQA.

Yes, they're both trash. EC++ was even worse "don't use namespaces because we don't know what they are for", but I think nobody remembers it anymore.
Yeah sure. Google is such a pathetic company, all their projects fail spectacularly, they never made anything decent, nobody uses any of their shitty products. Its obvious they know nothing about programming.
Google is a great company, but their C++ style guide is an unfortunate disaster. Plenty of people who work there are very vocal about it, too.
Anyway, this thread was supposed to be about good practices.
closed account (iAk3T05o)
Almost everyone uses Google's products. Android is their product. Almost every non-i or windows phone uses Android OS. A lot of people use Google chrome. They created the first semi-self driving car. They are a great company :).
Last edited on
Effective C++ by Scott Meyers
@ NT3: Interesting FAQ...the author has a sense of humour too. I like it xD.

@ Nathan2222: Being famous and an oligopolist in the software industry doesn't always necessarily mean that they are the best at programming ;).
Last edited on
+1 Effective C++

Also, Code Complete by Steve McConnell. It isn't C++ specific, but I read it for the first time when I was doing an internship in college, and it drastically and immediately improved my software development ability.
@Nathan2222: If it's not obvious, I was being sarcastic.
closed account (iAk3T05o)
They aren't the best but they really good. Competition being apple, Microsoft and (is there any other?).
Sorry Abramus.
@stormboy: you are the first person i've seen that has admitted to learning C++ to the point that nothing is new or interesting. All i usually see is "i've been programming for a million years in c++ but i still consider myself at intermediate level".
You mean Google hasn't renamed it from Android since buying it in 2005? Figured by now they would have done something dumb like G-roid or something.
you are the first person i've seen that has admitted to learning C++ to the point that nothing is new or interesting
that depends on what you find interesting. i might find coding standards interesting but stormboy might not.

. All i usually see is "i've been programming for a million years in c++ but i still consider myself at intermediate level".
it would be arrogant to say otherwise. ive seen some of the most brilliant coders on here (for example disch) learn something new. i doubt that there are very many actual experts (i could be wrong however)
Being an expert does not mean you know 100% of something.
i never said it did
I could list a few good practices, but they're all in Effective C++, as the others have mentioned. Superb book.

You can get a second hand edition on Amazon for less that $1. Probably an older edition but still very valid.
@Little Bobby Tables
The only person that I think can say they are a master of C++ and get away with it would probably be Bjarne Stroustrup, but even then I'd doubt he would ever say he is. I've always said, I'm a student of many languages and master of none.
Pages: 1234