Discovering Modern C++

Author: Peter Gottschling
Publisher: Addison-Wesley
Pages:480
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. 

 

Banner

 

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.

 

Banner


Android Programming: The Big Nerd Ranch Guide (5e)

Authors: Bryan Sills, Brian Gardner, Brian Hardy and Kristin Marsicano
Publisher: Addison-Wesley
Pages: 688
ISBN: 978-0137645541
Print: 0137645546
Kindle: B09WLF84W7
Audience: Kotlin programmers
Rating: 4.5
Reviewer: Mike James  

The Big Nerd Ranch Guide to Android is bac [ ... ]



SQL Server Advanced Troubleshooting and Performance Tuning (O'Reilly)

Author: Dmitri Korotkevitch
Publisher: O'Reilly
Pages: 497
ISBN: 978-1098101923
Print:1098101928
Kindle: B0B197NYD7
Audience: DBAs & database devs
Rating: 5
Reviewer: Ian Stirk

This book aims to improve the performance of your SQL Servers, how does it fare?


More Reviews

<ASIN:1491903996>

 

 

 

Last Updated ( Wednesday, 06 July 2016 )