问题
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:
Write for a year later.
回答2:
I vote for: "avoid considering goto, naming notation and indentation as being the subjects of coding rules"
回答3:
Rule 102: Any change to expected functionality should result in a regression test that fails.
回答4:
"Use RAII judiciously"
回答5:
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 ?
来源:https://stackoverflow.com/questions/215470/c-coding-guideline-102