- 出版社: Addison-Wesley Professional; 1 (2004年8月12日)
- 丛书名: C++ In-Depth Series
- 平装: 352页
- 语种： 英语
- ISBN: 0201760428
- 条形码: 0785342760422, 9780201760422
- 商品尺寸: 18.5 x 2 x 22.9 cm
- 商品重量: 553 g
- ASIN: 0201760428
- 用户评分: 分享我的评价
- 亚马逊热销商品排名: 图书商品里排第3,383,717名 (查看图书商品销售排行榜)
Exceptional C++ Style: 40 New Engineering Puzzles, Programming Problems, and Solutions (英语) 平装 – 2004年8月12日
Herb Sutter is the author of three highly acclaimed books, Exceptional C++ Style, Exceptional C++, and More Exceptional C++ (Addison-Wesley). He chairs the ISO C++ standards committee, and is contributing editor and columnist for C/C++ Users Journal. As a software architect for Microsoft, Sutter leads the design of C++ language extensions for .NET programming.
GENERIC PROGRAMMING AND THE C++ STANDARD LIBRARY.
1. Uses and Abuses of vector.
2. The String Formatters of Manor Farm, Part 1: sprintf.
3. The String Formatters of Manor Farm, Part 2: Standard (or Blindingly Elegant) Alternatives.
4. Standard Library Member Functions.
5. Flavors of Genericity, Part 1: Covering the Basis [sic].
6. Flavors of Genericity, Part 2: Generic Enough?
7. Why Not Specialize Function Templates?
8. Befriending Templates.
9. Export Restrictions, Part 1: Fundamentals.
10. Export Restrictions, Part 2: Interactions, Usability Issues, and Guidelines.
EXCEPTION SAFETY ISSUES AND TECHNIQUES.
11. Try and Catch Me.
12. Exception Safety: Is It Worth It?
13. A Pragmatic Look at Exception Specifications.
CLASS DESIGN, INHERITANCE, AND POLYMORPHISM.
14. Order, Order!
15. Uses and Abuses of Access Rights.
16. (Mostly) Private.
19. Enforcing Rules for Derived Classes.
MEMORY AND RESOURCE MANAGEMENT.
20. Containers in Memory, Part 1: Levels of Memory Management.
21. Containers in Memory, Part 2: How Big Is It Really?
22. To new, Perchance to throw, Part 1: The Many Faces of new.
23. To new, Perchance to throw, Part 2: Pragmatic Issues in Memory Management.
OPTIMIZATION AND EFFICIENCY.
24. Constant Optimization?
25. inline Redux.
26. Data Formats and Efficiency, Part 1: When Compression Is the Name of the Game.
27. Data Formats and Efficiency, Part 2: (Even Less) Bit-Twiddling.
TRAPS, PITFALLS, AND PUZZLERS.
28. Keywords That Aren't (or, Comments by Another Name).
29. Is It Initialization?
30. double or Nothing.
31. Amok Code.
32. Slight Typos? Graphic Language and Other Curiosities.
33. Operators, Operators Everywhere.
STYLE CASE STUDIES.
34. Index Tables.
35. Generic Callbacks.
36. Construction Unions.
37. Monoliths "Unstrung," Part 1: A Look at std::string.
38. Monoliths "Unstrung," Part 2: Refactoring std::string.
39. Monoliths "Unstrung," Part 3: std::string Diminishing.
40. Monoliths "Unstrung," Part 4: std::string Redux.
|5 星 (0%)|
|4 星 (0%)|
|3 星 (0%)|
|2 星 (0%)|
|1 星 (0%)|
As an example, the items that I found most memorable included his investigation of how compilers failed to adhere to the standard when it comes to template friend function look up, with the surprising result that the normally reliable g++ is the worst offender. Additionally, he demonstrates several ways to call private member functions from outside of a class. I'm certain that fans of the last two books will get a kick out of this stuff, but it's not quite at the same level as his work designing for exception safety.
In addition to the usual question-essay-guideline format, the book has a substantial final section dissecting some failings of publicly-available code, which is where I assume the title of the book comes from. Those with fond memories of Tom Cargill's C++ Programming Style will definitely like this bit.
Despite the fact that the material is arguably slightly thinner than usual, the number of pages is actually up on the previous books. Sutter's writing style has also expanded. However, in a couple of places, the writing could have done with some editing. There are some witty asides and extraneous material that take up just a bit too much space.
Nonetheless, Sutter-nutters will probably not be too disappointed by Exceptional C++ Style. I still really enjoyed this book; reading it was time well spent.
The only problem now that I have is, with all three of these books on my shelf, it takes longer to figure out where I read something of on a particular topic. The topical sections of each book overlap (E.g., sections covering exception eafety, memory managment and inheritance appear in all three books.) and they are all written at the same level of difficulty overall. The later books do make plenty of references back to the earlier ones as well as some other very good C++ books but this material would be better organized in one volume rather than three. Perhaps they should have been published as three editions of the same book rather than three separate books. That's the only thing I can think of that would have made them more useful. Even so this book, like the other two, is very good exercise for keeping C++ programming skills sharp. Well done!
There is something for everyone in this book, from the obscure and astonishing ("How many consecutive '+' characters can appear in a standards-conforming program?"), to the pragmatic ("When should you use inlining?"), to the advanced ("How generic should you make your templates, and why?").
I've been programming in C++ for 16 years now, and I learned quite a lot from reading this book. Yet, you don't have to be a C++ veteran to appreciate the advice that is provided: novice C++ programmers will find the items just as useful as old hands at C++ programming.
The book is well written, in clear and concise style, and never boring. (A number of creative footnotes even produce the occasional laugh.) The material is well organized, presented in groups of topics that relate to each other, and the table of contents and index make it easy to locate a topic for reference. And the bibliography contains things that are actually worth reading, rather than meaningless filler material.
I most appreciated Herb's honesty when dealing with various not-so-great aspects of C++. He doesn't shy back from pointing out when things are bad and simply shouldn't be used (such as exception specifications). The items I enjoyed the most are about the design of std::string, which Herb dissects (or should I say "trashes"?) unmercifully. To me, the book is worth buying just for these items alone because they provide splendid insight into what distinguishes good design from bad design, and how methodical and clear thinking is essential to writing good programs. ("Beware the behemoth of the Winnebago class -- it will haunt you onto the fourth generation...")
In summary, I think every C++ programmer should read this book. Yes, it's *that* good.