C++ Coding Standards 读书笔记一

来源:互联网 发布:自己开淘宝店怎么代理 编辑:程序博客网 时间:2024/06/05 10:51
  1. Programs must be written for people to read, and only incidently for machines to execute.  --

    Harold Abelson and Gerald Jay Sussman

  2. KISS (Keep It Simple Software): Correct is better than fast. Simple is better than complex. Clear is better than cute. Safe is better than insecure.
  3. Don't optimize prematurely, and don't pessimize prematurely.
  4. It is far, far easier to make a correct program fast than it is to make a fast program correct.
  5. C++ 's "resource acquisition is initialization" (RAII) idiom is the power tool for correct resource handing. When allocating a raw resource, immediately pass it to an owning object. Never allocate more than one resouce in a single statement.

ps: Chapter 12 has not been read.

原创粉丝点击