Exceptional C++: 47 Engineering Puzzles, Programming Problems, and Solutions

4.15 avg rating
( 297 ratings by Goodreads )
 
9780201615623: Exceptional C++: 47 Engineering Puzzles, Programming Problems, and Solutions

Exceptional C++ shows by example how to go about sound software engineering in standard C++. Do you enjoy solving thorny C++ problems and puzzles? Do you relish writing robust and extensible code? Then take a few minutes and challenge yourself with some tough C++ design and programming problems. The puzzles and problems in Exceptional C++ not only entertain, they will help you hone your skills to become the sharpest C++ programmer you can be. Many of these problems are culled from the famous Guru of the Week feature of the Internet newsgroup comp.lang.c++.moderated, expanded and updated to conform to the official ISO/ANSI C++ Standard. Each problem is rated according to difficulty and is designed to illustrate subtle programming mistakes or design considerations. After youve had a chance to attempt a solution yourself, the book then dissects the code, illustrates what went wrong, and shows how the problem can be fixed. Covering a broad range of C++ topics, the problems and solutions address critical issues such as: *Generic programming and how to write reusable templates *Exception safety issues and techniques *Robust class design and inheritance *Compiler firewalls and the Pimpl I

"synopsis" may belong to another edition of this title.

Review:

Aimed at the experienced C++ programmer, Herb Sutter's Exceptional C++ tests the reader's knowledge of advanced C++ language features and idioms with several dozen programming puzzles and explanations. This book can definitely help raise your C++ class design skills to the next level.

Based on the author's Guru of the Week Web column, this book poses a series of challenging questions on the inner workings of C++, centering around generic programming with the Standard Template Library (STL), exception handling, memory management, and class design. Even if you think you know C++ well, most of these problems will teach you something more about the language and how to write more robust classes that are "exception safe" (meaning they don't throw any handled exceptions or leak resources). Don't think this is just "language lawyering," though. The author's explanations stress sound programming principles (favoring simplicity) and idioms (such as the Pimpl idiom for class design that promotes faster compile times and better maintainability, or using "smart" auto_ptrs with STL.) Judging from the range and depth of these examples, Sutter's command of the inner workings of C++ is impressive, and he does an excellent job of conveying this expertise without jargon or a lot of theory.

After reading this book, C++ designers will learn several "best practices" of how to write robust, efficient classes that are "exception safe." Chances are you'll gain a better understanding of memory management techniques and working with STL too. For the experienced developer seeking leading-edge knowledge of some of the best ways to use C++, Exceptional C++ is both a challenging and truly worthwhile source of information. --Richard Dragan

Topics covered: Advanced C++ programming tutorial, generic programming, tips for string classes, containers and STL, temporary objects, exception-safe code tutorial, virtual functions, class inheritance, the Pimpl idiom, namespaces, memory management, C++ memory areas, overloading new and delete, using smart pointer with auto_ptr, using const, casts, and hints for better performance and code maintainability.

From the Inside Flap:

Exceptional C++ shows by example how to go about solid software engineering. Along with a lot of other material, this book includes expanded versions of the first 30 issues of the popular Internet C++ feature Guru of the Week (or, in its short form, GotW), a series of self-contained C++ engineering problems and solutions that illustrate specific design and coding techniques.

This book isn't a random grab-bag of code puzzles; it's primarily a guide to sound real-world enterprise software design in C++. It uses a problem/solution format because that's the most effective way I know to involve you, gentle reader, in the ideas behind the problems and the reasons behind the guidelines. Although the Items cover a variety of topics, you'll notice recurring themes that focus on enterprise development issues, particularly exception safety, sound class and module design, appropriate optimization, and writing portable standards-conforming code.

I hope you find this material useful in your daily work. But I also hope you find at least a few nifty thoughts and elegant techniques, and that from time to time, as you're reading through these pages, you'll suddenly have an "Aha! Gnarly!" moment. After all, who says software engineering has to be dull? How to Read This Book

I expect that you already know the basics of C++. If you don't, start with a good C++ introduction and overview (good choices are a classic tome like Bjarne Stroustrup's The C++ Programming Language, Third Edition 1 or Stan Lippman and JosEe Lajoie's C++ Primer, Third Edition 2 ), and then be sure to pick up a style guide like Scott Meyers' classic Effective C++ books (I find the browser-based CD version convenient and useful).3

Each item in this book is presented as a puzzle or problem, with an introductory header that looks like this:

ITEM ##: THE TOPIC OF THIS PUZZLE DIFFICULTY: X  

The topic tag and difficulty rating (typically anything from 3 to 9-1/2, based on a scale of 10) gives you a hint of what you're in for. Note that the difficulty rating is my own subjective guess at how difficult I expect most people will find each problem, so you may well find that a given 7 problem is easier for you than another 5 problem. Still, it's better to be prepared for the worst when you see a 9-1/2 monster coming down the pike.

You don't have to read the sections and problems in order, but in several places there are "miniseries" of related problems that you'll see designated as "Part 1," "Part 2," and so onosome all the way up to "Part 10." Those miniseries are best read as a group. How We Got Here: GotW and PeerDirect

The C++ Guru of the Week series has come a long way. GotW was originally created late in 1996 to provide interesting challenges and ongoing education for our own development team here at PeerDirect. I wrote it to provide an entertaining learning tool, including rants on things like the proper use of inheritance and exception safety. As time went on, I also used it as a means to provide our team with visibility to the changes being made at the C++ standards meetings. Since then, GotW has been made available to the general C++ public as a regular feature of the Internet newsgroup comp.lang.c++.moderated, where you can find each new issue's questions and answers (and a lot of interesting discussion).

Using C++ well is important at PeerDirect for many of the same reasons it's important in your company, if perhaps to achieve different goals. We happen to build systems softwareo for distributed databases and database replicationoin which enterprise issues such as reliability, safety, portability, efficiency, and many others are make-or-break concerns. The software we write needs to be able to be ported across various compilers and operating systems; it needs to be safe and robust in the presence of database transaction deadlocks and communications interruptions and programming exceptions; and it's used by customers to manage tiny databases sitting inside smart cards and pop machines or on PalmOS and WinCE devices, through to departmental Windows NT and Linux and Solaris servers, through to massively parallel Oracle back-ends for Web servers and data warehouseso with the same software, the same reliability, the same code. Now that's a portability and reliability challenge, as we creep up on half a million tight, noncomment lines of code.

To those of you who have been reading Guru of the Week on the Internet for the past few years, I have a couple of things to say:

Thank you for your interest, support, e-mails, kudos, corrections, comments, criticisms, questionsoand especially for your requests for the GotW series to be assembled in book form. Here it is; I hope you enjoy it. This book contains a lot more than you ever saw on the Internet.

Exceptional C++ is not just a cut-and-paste of stale GotW issues that are already floating out there somewhere in cyberspace. All the problems and solutions have been considerably revised and reworkedofor example, Items 8 through 17 on exception safety originally appeared as a single GotW puzzle and have now become an in-depth, 10-part miniseries. Each problem and solution has been examined to bring it up to date with the then-changing, and now official, C++ standard.

So, if you've been a regular reader of GotW before, there's a lot that's new here for you. To all faithful readers, thanks again, and I hope this material will help you continue to hone and expand your software engineering and C++ programming skills. Herb Sutter
June 1999

1. Stroustrup B. The C++ Programming Language, Third Edition (Addison Wesley Longman, 1997).
2. Lippman S. and Lajoie J. C++ Primer, Third Edition (Addison Wesley Longman, 1998).
3. Meyers S. Effective C++ CD: 85 Specific Ways to Improve Your Programs and Designs (Addison Wesley Longman, 1999). An online demo is available at meyerscd.awl.
0201615622P04062001

"About this title" may belong to another edition of this title.

Top Search Results from the AbeBooks Marketplace

1.

Sutter, Herb
Published by Prentice Hall
ISBN 10: 0201615622 ISBN 13: 9780201615623
New Quantity Available: > 20
Seller:
INDOO
(Avenel, NJ, U.S.A.)
Rating
[?]

Book Description Prentice Hall. Book Condition: New. Brand New. Bookseller Inventory # 0201615622

More Information About This Seller | Ask Bookseller a Question

Buy New
US$ 40.28
Convert Currency

Add to Basket

Shipping: US$ 3.50
Within U.S.A.
Destination, Rates & Speeds

2.

Herb Sutter
Published by Pearson Education (US), United States (2017)
ISBN 10: 0201615622 ISBN 13: 9780201615623
New Paperback Quantity Available: 1
Seller:
The Book Depository
(London, United Kingdom)
Rating
[?]

Book Description Pearson Education (US), United States, 2017. Paperback. Book Condition: New. Language: English . Brand New Book. Exceptional C++ shows by example how to go about sound software engineering in standard C++. Do you enjoy solving thorny C++ problems and puzzles? Do you relish writing robust and extensible code? Then take a few minutes and challenge yourself with some tough C++ design and programming problems. The puzzles and problems in Exceptional C++ not only entertain, they will help you hone your skills to become the sharpest C++ programmer you can be. Many of these problems are culled from the famous Guru of the Week feature of the Internet newsgroup comp.lang.c++.moderated, expanded and updated to conform to the official ISO/ANSI C++ Standard. Each problem is rated according to difficulty and is designed to illustrate subtle programming mistakes or design considerations. After you ve had a chance to attempt a solution yourself, the book then dissects the code, illustrates what went wrong, and shows how the problem can be fixed.Covering a broad range of C++ topics, the problems and solutions address critical issues such as: *Generic programming and how to write reusable templates *Exception safety issues and techniques *Robust class design and inheritance *Compiler firewalls and the Pimpl Idiom *Name lookup, namespaces, and the Interface Principle *Memory management issues and techniques *Traps, pitfalls, and anti-idioms *Optimization Try your skills against the C++ masters and come away with the insight and experience to create more efficient, effective, robust, and portable C++ code. 0201615622B04062001. Bookseller Inventory # AAB9780201615623

More Information About This Seller | Ask Bookseller a Question

Buy New
US$ 44.00
Convert Currency

Add to Basket

Shipping: FREE
From United Kingdom to U.S.A.
Destination, Rates & Speeds

3.

Herb Sutter
Published by Pearson Education (US), United States (2017)
ISBN 10: 0201615622 ISBN 13: 9780201615623
New Paperback Quantity Available: 1
Seller:
The Book Depository US
(London, United Kingdom)
Rating
[?]

Book Description Pearson Education (US), United States, 2017. Paperback. Book Condition: New. Language: English . Brand New Book. Exceptional C++ shows by example how to go about sound software engineering in standard C++. Do you enjoy solving thorny C++ problems and puzzles? Do you relish writing robust and extensible code? Then take a few minutes and challenge yourself with some tough C++ design and programming problems. The puzzles and problems in Exceptional C++ not only entertain, they will help you hone your skills to become the sharpest C++ programmer you can be. Many of these problems are culled from the famous Guru of the Week feature of the Internet newsgroup comp.lang.c++.moderated, expanded and updated to conform to the official ISO/ANSI C++ Standard. Each problem is rated according to difficulty and is designed to illustrate subtle programming mistakes or design considerations. After you ve had a chance to attempt a solution yourself, the book then dissects the code, illustrates what went wrong, and shows how the problem can be fixed.Covering a broad range of C++ topics, the problems and solutions address critical issues such as: *Generic programming and how to write reusable templates *Exception safety issues and techniques *Robust class design and inheritance *Compiler firewalls and the Pimpl Idiom *Name lookup, namespaces, and the Interface Principle *Memory management issues and techniques *Traps, pitfalls, and anti-idioms *Optimization Try your skills against the C++ masters and come away with the insight and experience to create more efficient, effective, robust, and portable C++ code. 0201615622B04062001. Bookseller Inventory # AAB9780201615623

More Information About This Seller | Ask Bookseller a Question

Buy New
US$ 44.03
Convert Currency

Add to Basket

Shipping: FREE
From United Kingdom to U.S.A.
Destination, Rates & Speeds

4.

Herb Sutter
Published by Pearson Education (US), United States (2017)
ISBN 10: 0201615622 ISBN 13: 9780201615623
New Paperback Quantity Available: 10
Seller:
Book Depository hard to find
(London, United Kingdom)
Rating
[?]

Book Description Pearson Education (US), United States, 2017. Paperback. Book Condition: New. Language: English . This book usually ship within 10-15 business days and we will endeavor to dispatch orders quicker than this where possible. Brand New Book. Exceptional C++ shows by example how to go about sound software engineering in standard C++. Do you enjoy solving thorny C++ problems and puzzles? Do you relish writing robust and extensible code? Then take a few minutes and challenge yourself with some tough C++ design and programming problems. The puzzles and problems in Exceptional C++ not only entertain, they will help you hone your skills to become the sharpest C++ programmer you can be. Many of these problems are culled from the famous Guru of the Week feature of the Internet newsgroup comp.lang.c++.moderated, expanded and updated to conform to the official ISO/ANSI C++ Standard. Each problem is rated according to difficulty and is designed to illustrate subtle programming mistakes or design considerations. After you ve had a chance to attempt a solution yourself, the book then dissects the code, illustrates what went wrong, and shows how the problem can be fixed.Covering a broad range of C++ topics, the problems and solutions address critical issues such as: *Generic programming and how to write reusable templates *Exception safety issues and techniques *Robust class design and inheritance *Compiler firewalls and the Pimpl Idiom *Name lookup, namespaces, and the Interface Principle *Memory management issues and techniques *Traps, pitfalls, and anti-idioms *Optimization Try your skills against the C++ masters and come away with the insight and experience to create more efficient, effective, robust, and portable C++ code. 0201615622B04062001. Bookseller Inventory # BZV9780201615623

More Information About This Seller | Ask Bookseller a Question

Buy New
US$ 55.78
Convert Currency

Add to Basket

Shipping: FREE
From United Kingdom to U.S.A.
Destination, Rates & Speeds

5.

Sutter, Herb
Published by Addison Wesley (1999)
ISBN 10: 0201615622 ISBN 13: 9780201615623
New Paperback Quantity Available: 1
Seller:
Swan Books
(Essex, United Kingdom)
Rating
[?]

Book Description Addison Wesley, 1999. Paperback. Book Condition: New. This book shows, by example, how to go about sound software engineering in standard C++. Do you enjoy solving thorny C++ problems and puzzles? Do you relish writing robust and extensible code? Then take a few minutes and challenge yourself with some tough C++ designe and programming problems. Bookseller Inventory # 002777

More Information About This Seller | Ask Bookseller a Question

Buy New
US$ 36.73
Convert Currency

Add to Basket

Shipping: US$ 19.82
From United Kingdom to U.S.A.
Destination, Rates & Speeds

6.

Herb Sutter
Published by Addison-Wesley Professional (1999)
ISBN 10: 0201615622 ISBN 13: 9780201615623
New Paperback Quantity Available: 1
Seller:
Ergodebooks
(RICHMOND, TX, U.S.A.)
Rating
[?]

Book Description Addison-Wesley Professional, 1999. Paperback. Book Condition: New. Bookseller Inventory # DADAX0201615622

More Information About This Seller | Ask Bookseller a Question

Buy New
US$ 59.46
Convert Currency

Add to Basket

Shipping: US$ 3.99
Within U.S.A.
Destination, Rates & Speeds

7.

Sutter, Herb
Published by Addison-Wesley Professional (1999)
ISBN 10: 0201615622 ISBN 13: 9780201615623
New Paperback Quantity Available: 2
Seller:
Murray Media
(North Miami Beach, FL, U.S.A.)
Rating
[?]

Book Description Addison-Wesley Professional, 1999. Paperback. Book Condition: New. Never used!. Bookseller Inventory # P110201615622

More Information About This Seller | Ask Bookseller a Question

Buy New
US$ 72.14
Convert Currency

Add to Basket

Shipping: US$ 1.99
Within U.S.A.
Destination, Rates & Speeds

8.

Herb Sutter
Published by Addison-Wesley Professional (1999)
ISBN 10: 0201615622 ISBN 13: 9780201615623
New Softcover Quantity Available: > 20
Seller:
Palexbooks
(Sanford, NC, U.S.A.)
Rating
[?]

Book Description Addison-Wesley Professional, 1999. Book Condition: New. Brand new! Please provide a physical shipping address. Bookseller Inventory # 9780201615623

More Information About This Seller | Ask Bookseller a Question

Buy New
US$ 72.16
Convert Currency

Add to Basket

Shipping: US$ 3.00
Within U.S.A.
Destination, Rates & Speeds

9.

Sutter, Herb
Published by Addison-Wesley Professional
ISBN 10: 0201615622 ISBN 13: 9780201615623
New PAPERBACK Quantity Available: 3
Seller:
BarristerBooks
(Lawrence, KS, U.S.A.)
Rating
[?]

Book Description Addison-Wesley Professional. PAPERBACK. Book Condition: New. 0201615622 BRAND NEW W/FAST SHIPPING! This item is: Exceptional C++: 47 Engineering Puzzles, Programming Problems, and Solutions, 1st Ed., 2000, by Sutter, Herb; FORMAT: Paperback; ISBN: 9780201615623. Choose Expedited for fastest shipping! Our 98%+ rating proves our commitment! We cannot ship to PO Boxes/APO address. To avoid ordering the wrong item, please check your item's ISBN number!. Bookseller Inventory # P9780201615623

More Information About This Seller | Ask Bookseller a Question

Buy New
US$ 75.54
Convert Currency

Add to Basket

Shipping: FREE
Within U.S.A.
Destination, Rates & Speeds

10.

Herb Sutter
Published by Addison-Wesley (1999)
ISBN 10: 0201615622 ISBN 13: 9780201615623
New Paperback Quantity Available: 1
Seller:
Revaluation Books
(Exeter, United Kingdom)
Rating
[?]

Book Description Addison-Wesley, 1999. Paperback. Book Condition: Brand New. illustrated edition. 240 pages. 9.25x7.50x0.50 inches. In Stock. Bookseller Inventory # 0201615622

More Information About This Seller | Ask Bookseller a Question

Buy New
US$ 83.84
Convert Currency

Add to Basket

Shipping: US$ 7.93
From United Kingdom to U.S.A.
Destination, Rates & Speeds

There are more copies of this book

View all search results for this book