|Discovering Modern C++|
Author: Peter Gottschling
Modern C++ who would want to write anything else? Is this a suitable introduction for the rest of us?
The subtitle gives the game way immediately: An Intensive Course for Scientists, Engineers, and Programmers. All I can say is that, for once, the title of a book is very accurate. If you don't fall into one of these categories you probably are not going to enjoy or get much from this book. If you do, it is a very different story.
My first comment is that this is a strange book - but in a good way. It is an odd mix of bottom-up presentation in the style of, say, K&R plus a very chatty style, full of off-the-cuff remarks. This makes it a strange mix of a reference manual and a discursive introduction to ideas.
The reference manual part of the presentation can mostly be ignored when you are just reading it, but my guess is that you will return to it as soon as you encounter something unexpected while programming. As the book moves on, the reference aspect becomes less and less and the tutorial aspect starts to dominate.
Chapter 2 launches into object-oriented features of C++ - classes, members, constructors, destructors, accessing members, operator overloading and more. The style here isn't quite a reference and there are lots of discussions, such as what the copy constructor is for and why you might want to write one. Anything that is fairly obvious is just presented to you as a reference text and it is only the less than obvious that is explained in detail.
Where do you think the author is going to go next? No not more objects but deep into generics. The reason, I can only guess, is that for scientists and the like expressing algorithms in a type-independent way is a priority. It is, but it is still early for generics to feature in such detail. Chapter 3 not only covers the basic ideas but some of the newer "modern" C++ features, such as lambdas, variadic templates, functors and so on. At this point you also cannot miss the fact any longer that the examples are from applied math - numerical integration for example.
Chapter 4 introduces the standard template library - again a good choice for a book aimed at the technical programmer. Here we learn not just about containers but complex numbers, tuples and libraries that go beyond the standard template library with a distinct applied math emphasis - linear algebra, OEDs, PDEs and graph algorithms.
Chapter 5 is about meta programming which is again "modern" and not something that all C++ programmers would want to know about in such detail - type traits, conditional exceptions, compiler optimizations and so on.
The final chapter on C++ returns to object-orientation, which has played a minor role so far given how central it is to C++, after all it is what makes C++ a step on from C. In this chapter we learn about some very advanced ideas like multiple inheritance and many things that should have been known much earlier in the book - derived classes, the inheritance type hierarchy, casting and so on.
The final, final chapter of the book is about scientific projects and here we discover what the author is really interested in using C++ for. The projects are mostly about solving differential equations. Is C++ really the new Fortran?
This is an excellent book as long as you are not a complete beginner and are a scientist or similar and are particularly interested in C++ as a numerical or scientific programming language. if you fall outside of this target audience then how much you will like the book depends entirely on how far outside the audience you are.
If you do fit the requirements, this is a great book and my rating of 5 is on this basis. Otherwise it probably gets a rating of 2 or even lower indicating how unhelpful it is going to be.
If you are a scientist programmer wanting to use C++ in a modern idiom go and buy a copy.
Effective Modern C++ by Scott Myers Rated 4 by Mike James with the conclusion:
For C++ experts this is a must read book - everyone else keep away.
|Last Updated ( Wednesday, 06 July 2016 )|