views:

607

answers:

6

If you were allowed to add another coding guideline to the 101 guidelines of the "C++ coding standards" (Herb Sutter and Andrei Alexandrescu), which would you add?

+1  A: 

I vote for: "avoid considering goto, naming notation and indentation as being the subjects of coding rules"

Nicola Bonelli
This is very similar to "don't sweat the small stuff".
Richard Corden
+4  A: 

Write for a year later.

Paul Nathan
A: 

Rule 102: Any change to expected functionality should result in a regression test that fails.

Richard Corden
I agree. But it's not really a C++-rule.
JesperE
Several of the existing 101 rules are not C++ specific.
Richard Corden
A: 

"Use RAII judiciously"

Martin Cote
Could you elaborate? Has RAII hidden dangers that escaped our notice?
paercebal
Less experienced coders have no idea of what's "judicious" and more experienced one may have professional differences of opinion, so this falls a bit short of a useful guideline. A good guideline would define what's judicious.
DarenW
A: 

Prefer constructors to init()/setup() functions.

Why manipulating an object that may be in an unusable state? Isn't it better to not have it at all ?

Luc Hermitte