Discovering Modern C++

Author: Peter Gottschling
Publisher: Addison-Wesley
ISBN: 978-0134383583
Print: 0134383583 
Kindle: B019YLYLWI
Audience: Scientific programmers interested in C++
Rating: 5
Reviewer: Mike James

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 1 starts off with the very low level details of C++ - constants, literals, operators, expressions, functions, error handling and so on. If you have no idea how to program this is going to mean nothing at all to you. Even if you program a little in a non-technical language like JavaScript, this is going to be too dense and too much. As long as you have encountered this material before in another language there should be no problem and you will be aware that skim reading, looking out for the author's comments' is the best way to get to chapter 2. By the time you reach the end of the introductory chapter you have completed a crash course in the foundations of the language by reading an annotated reference manual.

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.

Related Reviews

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. 



To keep up with our coverage of books for programmers, follow @bookwatchiprog on Twitter or subscribe to I Programmer's Books RSS feed for each day's new addition to Book Watch and for new reviews.



Accelerating Software Quality

Author: Eran Kinsbruner
Publisher: Perforce
Pages: 357
ISBN: 978-8671126044
Print: B08FKW8B9B
Audience: Devops developers
Rating: 3
Reviewer: Kay Ewbank

With a subtitle of 'machine learning and artificial intelligence in the age of devops', this book certainly sounds as though it fits c [ ... ]

PHP In Easy Steps, 4th Ed

Author: Mike McGrath
Publisher: In Easy Steps
Date: April 2021
Pages: 192
ISBN: 978-1840789232
Print: 1840789239
Kindle: B08ZSV3MNH
Audience: People wanting to learn PHP
Rating: 4
Reviewer: Ian Elliot
PHP isn't a fashionable language, but this doesn't mean it isn't worth learning.

More Reviews





Last Updated ( Wednesday, 06 July 2016 )