More Exceptional C++(中文版)

(美)舒特 著, 於春景 译

出版时间

2010-12-31

ISBN

9787121125928

评分

★★★★★

标签

编程

书籍介绍

对c++程序员来说,iso/ansi c++标准的问世标志着一个新纪元的开始。c++标准为程序设计提供了很多新的便利和可能,但要想在如此众多的信息中挖掘到其中的精髓,现实世界中的程序员缺少足够的时间。本书针对一定的主题,为程序员提供了简明扼要的指导,从而将学习时间和疑惑减至最少。本书内容包括泛型程序设计与c++标准库、优化与性能、异常安全议题及技术、继承与多态、内存及资源管理、自由函数与宏等。

本书内容全面丰富,论述翔实清晰,作者权威且经验丰富,是c++程序员的必备读物。

精彩摘录
  • "精简会带来晦涩,过度的精简不适合应用到产品代码中。 准则:尽量提高可读性,避免编写晦涩的精简代码。"
  • "Make a function inline directs the compiler that it may choose to place a copy of the function's code directly into each place the code is used. In the cases where the compiler does so, it avoids generating a function call."
  • "If you're looking to improve efficiency in some way, always look to your algorithms and data structures first."
  • "Finally, note another practical reason for this: Profilers are a lot less good at identifying which inlined functions should NOT be inlined."
  • "Avoid inlining or detailed tuning until performance profiles prove the need."
  • "Without atomic integer operations, copy-on-write typically incurs a significant performance penalty. Even with atomic operations, COW can make common String operations take nearly 50% longer, even in single-threaded programs."
  • "In general, copy-on-write is often a bad idea in multithread-ready code. That's because the calling code can no longer know whether two distinct String objects actually share the same representation under the covers, so String must incur overhead to do enough serialization so that calling code can t"
  • "Most of COW(copy-on-write)'s primary advantage for small strings could be gained without COW by using a more efficient allocator."
作者简介
对每一位C++爱好者或C++专业程序员来说,Herb Sutter的名字应该不会让人感到陌生。作为ISO/ANSI C++标准委员会的委员,Herb Sutter不仅是C++程序设计领域公认的专家,还是深受程序员喜爱的技术讲师和作家。Herb Sutter在互联网上主持的Guru of the Week专栏广受欢迎,几乎成为每一位C++程序员的网上必读物。本书就是Guru of the Week的最新精华总结。
目录
目录回到顶部↑
与大师面对面(译序) ⅸ
序 ?
前言 ?ⅰ
泛型程序设计与c++标准库 1

显示全部
用户评论
除了模板那块劲有点大,其他都还好
“为什么不用C++写程序系列”之《More Exceptional C++》。
这本还真是More了一下前一本;上一本exception safety是重点,于是这本在这个话题上的着重点不多;相反,PART I和PART II倒是挺出彩。
一般般啦。
太久没写C++,以至于看了都没什么感觉了。。。需要练练手了
这本书里用很多内容讲了按需拷贝的知识。感觉收获很多
也算是c++必看书籍吧,这本讲的内容并非出现的情况较多的点,而是更多介绍了一些trick吧。
没有没more的那本力道足。异常安全的仍然非常好,表达式求值顺序估计一般人注意不到,function try block就是高手也会误解的,哈哈。书如其名。容器,迭代器失效,cow字符串,value_ptr,泛型编程/traits/编译约束,其他书也有,这里的例子太好。
下载
收藏