
C++ 编程规范
C++ coding standards
Herb Sutter · 初版 2004 年
10人推荐
10位读者提及
10次提及
为什么值得读
- 归纳出可作为通用基准的编程规范与要点
- 条目式结构适合每周学习一条并付诸工作实践
- 替代易出问题的旧技巧,规范生产代码风格
“统一且高质量的编码规范能够提升软件质量、缩短上市时间、促进团队协作、消除在无关紧要事项上浪费的时间,并简化维护工作。如今,两位全球最受推崇的 C++ 专家将全球 C++ 社区丰富的集体经验浓缩为一套编码规范,供每位开发者和开发团队理解并用作制定自身编码规范的基础。
Hacker News 上怎么说
正在加载完整评论……
……那些我们轻松用更好的非宏技术替代掉的遗留宏黑魔法;还有 Qt 的预处理器,我们在生产环境代码里压根就没用过。关于 C++ 代码风格的各种争论早就被嚼烂了。如果我没记错的话,《C++ Coding Standards》相当不错:http://www.amazon.com/Coding-Standards-Rules-Guidelines-Prac... 针对游戏和嵌入式软件,为了性能你还需要额外的规则。我不太明白为什么这也能算个缺点……
…legacy macro tricks that we easily replaced with better, non-macro techniques; and Qt's preprocessor, which we never actually used in production code. Style points for C++ have been rehashed endlessly. "C++ Coding Standards" is pretty good IIRC: http://www.amazon.com/Coding-Standards-Rules-Guidelines-Prac... For gaming and embedded software, you will need further rules for performance. I'm not sure why this is a ding…
Herb Sutter 和 Andrei Alexandrescu 写的《C++ Coding Standards: 101 Rules, Guidelines, and Best Practices》是一本短小精悍的好书。它并不教你 C++(或 C++11)语法,初看可能会觉得内容偏薄,但它为“现代”(21世纪)C++ 提供了非常中肯的建议,并且……
Herb Sutter and Andrei Alexandrescu's C++ Coding Standards: 101 Rules, Guidelines, and Best Practices is a great, little book. It does not teach C++ (or C++11) and seems a little light at first, but it provides good advice for "modern" (21st century) C++ and…
……规范,我推荐同一作者加上现任标准委员会主席合著的一本书:http://www.amazon.com/Coding-Standards-Rules-Guidelines-Prac.... 另一位层主推荐了 Google C++ Coding Standards,但尽管它们很火,在我看来并没有很好地契合“现代 C++”(Modern C++)。
…standards, I suggest a book by the same author plus the current chair of the standard committee: http://www.amazon.com/Coding-Standards-Rules-Guidelines-Prac.... Another commenter has suggested the Google C++ Coding Standards, but despite their popularity they do not conform very well to "Modern C++" as I understand it.
……Herb Sutter 写的《Exceptional C++》 - Herb Sutter 写的《Exceptional C++ Style》 --- - David Vandevoorde 和 Nicolai M. Josuttis 写的《C++ Templates - The Complete Guide》 - Andrei Alexandrescu 写的《Modern C++ Design》 - Herb Sutter 和 Andrei Alexandrescu 写的《C++ Coding Standards》 最后但同样重要的是,通读 C++ Standard 是掌握 C++ 的终极一步。这是我向任何真正想成为……的人推荐的书单。
…Exceptional C++ by Herb Sutter - Exceptional C++ Style by Herb Sutter --- - C++ Templates - The Complete Guide by David Vandevoorde and Nicolai M. Josuttis - Modern C++ Design - By Andrei Alexandrescu - C++ Coding Standards by Herb Sutter and Andrei Alexandrescu Last but not least, reading the C++ Standard is the last bit on the topic of C++ This is the list of books which I recommend anyone who really wants to become…
……规范对于 Google 内部超大型的 C++ 项目来说是合理的。各项目应该根据自身需求制定自己的规范。共识早就有了,你可以去读 Sutter 和 Alexandrescu 写的《C++ Coding Standards》。[2] 是有人在纠结 Firefox 是否该用一种大部分兼容 C++ 的语言来替代 C++。首先,他们抱怨的是内存安全(memory safety),而不是内存管理……
…guide that makes sense for the very large C++ projects inside Google. Projects should create their own guides based on their requirements. The common ground is already there, you can read about it in C++ Coding Standards by Sutter and Alexandrescu. [2] is someone wondering whether they should replace C++ with a mostly-C++-compatible language for Firefox. First of all, they are complaining about memory safety, not management…
……这里列几本帖子里其他地方还没见人提过的好书。- Sutter 的《Exceptional C++》系列 - Dewhurst 的《C++ Common Knowledge》和《C++ Gotchas》非常实用。- Sutter 和 Alexandrescu 合著的《C++ Coding Standards》也很好。
…Here are a few good ones that I haven't seen mentioned elsewhere in the thread. - Sutter's Exceptional C++ books - Dewhurst's C++ Common Knowledge and C++ Gotchas are useful. - Sutter/Alexandrescu's "C++ Coding Standards" is good, too.