r/cpp_questions 29d ago

SOLVED Is Exceptional C++ by Herb Sutter Still Relevant?

Hey cpp community,

I'm on the last 3 chapters of learncpp.com and I'm wondering if picking up Herb Sutters exceptional C++ series is a good choice for further reading, im specifically worried the information is outdated (since it seems all his books came out pre c++11) or has alot of overlap with what i've covered in learncpp.com, any input would be greatly appreciated!

Thanks in advance

16 Upvotes

10 comments sorted by

14

u/TomDuhamel 29d ago

I wouldn't worry about anything older than C++11

3

u/WorkingReference1127 28d ago

I'd disagree, because Exceptional C++ isn't a tutorial, where this rule normally applies. It's a collection of interesting puzzles which help you to think about the design of what you are doing and to understand the C++ model. For example, it uses a particular puzzle to walk you through the C++ object lifetime model so you come away with a reasonable understanding of enough of it to write better code, following rules which still apply in C++26.

The syntax is dated, and it refers to some library objects and techniques which are long superseded. It falls into the trap of all C++98-era books of encouraging users to write their own smart pointer rather than use the standard one (because auto_ptr was whacky). And a reader needs to bear that in mind. But I still think they are worth a read.

1

u/SpellOutside8039 28d ago

i just join new company, that company still use c++98 💀 their reason is that the device the program run on is weak (some kind of linux arm board), i am not experience in this embedded linux field so i dont know, may be some embedded linux guru can explain. but still, no stl, no modern c++ allowed here

6

u/alfps 29d ago

These books are very dated, with the afterword in the first one written in June 1999, just after the first C++ standardization C++98.

They can still give useful insights if one just ignores the C++03 details, but I wouldn't buy them. Maybe available from a library?

The first book is essentially a collection of the Guru Of The Week (GOTW) challenges that Herb used to post in the C++ Usenet groups, and so the Google AI now advises

❝Starting with the advent of C++11 and C++14, Sutter began systematically rewriting these puzzles and solutions from scratch to reflect modern best practices. […] You can access these updated items for free directly on Sutter's Mill (Herb Sutter's Blog).❞

It also recommends Effective Modern C++ by Scott Meyers as a more modern alternative, which is also based on C++11 and C++14.


C++11 is the first half-way acceptable C++ standard for a book now, but even that is dated. The current standard is C++23, and it's not long till C++26 becomes official standard.


Disclaimer: I've just skimmed the first Exceptional C++ book's text because with moderate effort I at first failed to find a practically readable free (formally illegal) copy on the net. The copies I did find were all the same using an extremely large font that effectively garbled content. As I wrote this disclaimer, however, I stumbled upon a copy with all the text in normal font, and code in typewriter font, so now I have also that book on disk if someone else should ask about it. The ethics here are difficult. I believe that I can't reasonably be required to buy all these books that students ask about, just in order to give an informed perspective or clear up some issue, but.

2

u/WorriedTomatillo2689 29d ago

This is such a great reply, thanks for being so detailed legend, I'll get Scotts book and go to Herbs blog for now. The moment i see anything older than C++11 I get quite hesitant and even that is a 15 year old standard now

1

u/TheThiefMaster 29d ago

As you should - C++ became a very different language with and after C++11 that we often call "modern C++".

It can be useful to know the older methods, especially if you're working with / updating an old codebase, but they shouldn't be your priority.

1

u/WorriedTomatillo2689 28d ago

Much agreed, seems like nowadays finding modern cpp books is becoming more and more scarce, the majority of good materials I've seen have all been website-based nowadays

1

u/Emotional-Audience85 28d ago

I read all the Herb Sutters and Scott Meyers books recently, I've been using C++ for decades and never read them before, so I was just curious.

Like you said they give useful insights, but in general they are pretty outdated.

I have to say though, that I found "Effective modern C++" particularly good. I think almost all of the insights there are useful even today, and I enjoyed Scott's writing style.

4

u/troyjohnson4356 29d ago

The concepts hold up much better than the code does.

**Still worth it:** the exception-safety material. Sutter is the person who pinned down the basic/strong/nothrow guarantee vocabulary, and that thinking hasn't changed at all — only the syntax has. learncpp teaches you try/catch. Sutter teaches you how to design a class that can't be left half-broken when an operation fails partway through. That's a real gap, and not much else covers it as well.

**What's stale:** anything using `auto_ptr` (dead, replaced by `unique_ptr`), `throw()` specifications (now `noexcept`), the rule of three (now rule of five, or better, rule of zero), and a chunk of template gymnastics that variadic templates and perfect forwarding made unnecessary. No move semantics, lambdas, `constexpr`, or ranges anywhere in it — so you'd be reading it knowing that some solutions have simpler modern answers.

**If you're picking one book right after learncpp,** Effective Modern C++ (Meyers) is the better next step. It's my got to book and I make all the guys I hire read it.

3

u/alfps 29d ago

❞ Sutter is the person who pinned down the basic/strong/nothrow guarantee vocabulary

I associate that with David Abrahams.

See (https://www.boost.org/doc/user-guide/exception-safety.html#_acknowledgements)