Exceptional C++中文版 - 萨特 (Sutter Herb)

Exceptional C++中文版

萨特 (Sutter Herb)

出版时间

1970-01-01

ISBN

9787508314853

评分

★★★★★
书籍介绍
本书详细地讨论了如何编写健壮高效的代码以及模块设计技术。本书采用了自问自答的语言风格,它讨论了实际程序设计中普遍存在的,又非常不易察觉的问题,并且进行了深刻的分析,提出了具有广泛意义的解决方案。本书值得每个想成为优秀c++程序员的人阅读。我相信,任何c++程序员都会在本书的阅读过程中有许多收获,甚至有一种醍醐灌顶,恍然大悟的收获和喜悦。
AI导读
核心看点
  • 深入解析C++异常安全编程与资源管理
  • 通过47个工程谜题剖析健壮代码设计
  • 探讨RAII惯用法及模块高内聚设计原则
适合谁读
  • 希望进阶的中高级C++程序员
  • 追求代码健壮性与高效性的开发者
  • 已阅读Effective C++系列的读者
读前提醒
  • 中文版翻译质量欠佳,建议参考原著
  • 内容紧凑深入,适合当作案头参考书
  • 需具备一定C++基础,否则阅读吃力
读者共识
  • C++程序员必读经典,醍醐灌顶
  • 难度高于Effective C++,信息量大
  • 虽内容稍显老旧,但核心思想永不过时

本导读基于书籍简介、目录、原文摘录、短评和书评生成,不等同于全文精读。

精彩摘录
  • "If a function isn't going to handle (or translate or deliberately absorb) an exception, it should allow the exception to propagate up to a caller who can handle it."
  • "Always structure your code so that resources are correctly freed and data is in a consistent state even in the presence of exceptions."
  • "Observe the canonical exception safety rules: Never allow an exception to escape from a destructor or from an overloaded operator delete() or operator delete[](); write every destructor and deallocation function as though it had an exception specification of "throw()"."
  • "Observe the canonical exception-safety rules: in each function, take all the code that right emit an exception and do all that work safely off to the side. Only then, when you know that the real work has succeeded, should you modify the program state (and clean up) using only nonthrowing operations."
  • "Prefer cohesion. Always endeavor to give each piece of code – each module, each class, each function – a single, well-defined responsibility."
  • "Always use the "resource acquisition is initialization" idiom to isolate resource ownership and management."
  • "Exception specifications can incur a performance overhead whether an exception is thrown or not, although many compilers are getting better at minimizing this. For widely-used operations and general-purpose containers, it may be better not to use exception specifications in order to avoid this overh"
  • "All destructors should always be implemented as though they had an exception specification of throw() -- that is, no exception must ever be allowed to propagate."
用户评论
读完了,有时间还是必读的,尤其是使用STL和关于Impl
翻译的不好啊
C++是个令人抓狂的语言,这本书其实还不错
当时这一系列的C++书是百读不厌!
内容有点老,但是紧凑而深入。
如果读了 E 和 ME,就没必要读这本书了。GotW式到表现形式导致信息量不多,三星足矣。
非常好的总结,大部分已看完
读过 Effective C++/More Effective C++后,仍能震撼你的作品。
可以说是对C++的高级技巧总结的最好的一套小册子了 很适合有一段开发经验后看,和之前自己遇到的问题总结类比,会有一种醍醐灌顶的大彻大悟
收藏