C++ Coding Guideline 102

前端 未结 5 2242
忘了有多久
忘了有多久 2021-02-08 23:35

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?

相关标签:
5条回答
  • 2021-02-08 23:52

    Write for a year later.

    0 讨论(0)
  • 2021-02-08 23:57

    "Use RAII judiciously"

    0 讨论(0)
  • 2021-02-09 00:03

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

    0 讨论(0)
  • 2021-02-09 00:07

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

    0 讨论(0)
  • 2021-02-09 00:11

    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 ?

    0 讨论(0)
提交回复
热议问题