Should I read the Exceptional C++ books if I've read the Effective C++ series [closed]
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 years ago.
Improve this questionI'm a practicing C++ programmer (on Unix and gcc 3.x) for the past 6-7 years. I've read Scott Meyer's Effective C++, More Effective C++ and Effective STL cover-to-cover and have lived and practiced his suggestions/techniques along with Boost. I would like to move on to the more advanced aspects of C++ - something along the lines of 'Modern C++ Design' by Andrei Alexandrescu. However, before starting to read this, I am wondering if I should spend time reading Herb Sutter's Exceptional C++ books as well. How would you compare the Effective C++ series with Sutter's books?
Thanks a lot in advance for your response.
Read as much as you can - differing perspectives are always valuable.
Yes, absolutely. Herb Sutter covers a lot of very important, but generally poorly understood areas of the language and provides lots of useful guidance for writing more robust code.
While it's true that much of the material originated on the gotw site, it is expanded and better organized in the books. If you can answer all of the problems correctly then you find that you are very rarely faced with code that you don't understand why it behaves like it does. You may also find yourself heading off many potential problems that you spot in code before they become real issues.
I got a lot more out of the Exceptional C++ books than I did out of Effective C++, but this is going to be a very personal thing.
Frankly, Herb Sutter yanks a lot in the exception safety ever since the introduction of the idea in one of the journals of the pre-2000 age. The fact he used it a lot on replication and transactional systems makes sense, and unless you are a huge follower and interested in only the software of such 'safety' kind you will be bored to death. Meyers is far more practical and engaging.
Besides, if you want to move on, there are other books in the series, notably from the legends and not the writers for the sake of writing. Look up the bits from Nicolai Josuttis (C++ Templates: The Complete Guide), Aleksey Gurtovoy (C++ Template Metaprogramming) and more recently 'Daddy 2' Stepanov. In my opinion, they are more influential, knowledgable, practical and shaping than anything DDJ or exception safety induced writeups...
And of course, if you ever need to go back to basics (and there is always a reason to), one of the best possible books on the subject is by the daddy himself: The C++ Programming Language (most underestimated and skimmed over book out there).
Read The Definitive C++ Book Guide and List. "Exceptional C++" is on the list.
I like the C++ Coding Standard book because it's just that, a coding standard.
Effective C++ introduces important ideas, and was my first read too. C++ Coding Standards however is shaped like a coding standard, which any person programming should have. There are a number of other coding standards available, Sutter's one has the advantage of being concise and well explained (only 100 items very neatly classified).
I would take the time, if I were you, to read the C++ Coding Standards and the Guru of the Week entries before moving on to meta-template programming.
Meta-template programming is interesting. I loved Modern C++ Programming and its approaches. However it is less used in practice I think, strengthen the basics as much as you can, then you can always play around with 'new' ideas.
I would absolutely recommend the Exceptional C++ books if you're looking to move into more advanced C++. My sense from reading both series is that the Effective C++ books tell you how to write code that doesn't completely suck, and the Exceptional C++ books tell you how to write code that's rock-solid and bulletproof. I was less taken with Modern C++ Design; if you want to get into serious template metaprogramming it's pretty much the definitive work, but I found it a little... out there for my taste, particularly where he builds this gloriously complicated template structure that'll bring tears to your eyes with its sheer beauty, and then mentions "Oh yeah, this doesn't actually work on any compiler that's currently available".
I found both books interesting and useful. There are lot of common topics and you might already know them, but certainly it will help.
精彩评论