tags:

views:

550

answers:

4

I have been reading C++ and writing small programs in it for more than a year. Recently I came across Law of The Big Three. I never knew about this law.

Accidentally, I found it here: Rule of Three.

May I know any other such laws in C++?

+7  A: 

For this kind of thing I recommend:

C++ Coding Standards: 101 Rules, Guidelines, and Best Practices

Daniel Earwicker
+14  A: 

You're probably looking for C++ "best practices", not "laws". This should help you searching on the net.

Moreover, there's a book called "C++ Coding Standards: 101 Rules, Guidelines, and Best Practices" by Herb Sutter and Andrei Alexandrescu which is supposed to be good, but I haven't read it myself. You can order it, e.g., over at amazon.com.

middus
+1 for "not laws" - there are few rules that should always be applied and always certain corner cases.
Georg Fritzsche
+1  A: 

Well, it seems everyone agree on the value of Herb Sutter and Andrei Alexandrescu's amazing book.

C++ Coding Standards is a most interesting read. The items are grouped very logically, and each item is detailed just enough that you understand the risk for not heeding the advice. Also each item comes with possible exception to the rule and why they are exception.

All in all it is a very valuable asset to one trying to put in place a number of practices, especially when installing code reviews.

There is another 'book' though only available in PDF / HTML format as far as I know. It is a mash-up of several standards referenced

High Integrity C++ is also very interesting in that it qualifies the items (Rule / Guideline distinction) and sometimes offer alternatives (two mutually exclusive advices). It is much more detailed than C++ coding standards so you might want to read it in second position :)

You can obtain the PDF version here, they will send it to you by email.

Matthieu M.
+4  A: 

I also find Scott Myers' "Effective C++" series very useful, written in a very readable and memorable style.

ShellShock