Clean C++
I want to make a short detour from my long series of posts about the C++ Core Guidelines. I read the excellent book “Clean C++” in the last few days and I cannot hesitate to write a review. Here is my review.
I hear often the question at the end of my seminars: What books should I read to become a better software developer? Here is one half of my answer: You should read Design Pattern: Elements of reusable object-oriented software, Pattern-Oriented Software Architecture, Clean Code, Working effectively with legacy code, and UML Distilled. Here is the other part of my answer: From the C++ perspective, you should read the books from Scott Meyers, Herb Sutter, and the C++ Core Guidelines. In total there are more than 3000 pages full of very precious content.
Now, my answer becomes quite easy. Read the book “Clean C++” by Stephan Roth. The book is the ideal fit for your breadth-first search. In your depth-first search read the classics, I mentioned before. Why?
The author achieved it in 300 pages by giving a very good but not superficial overview of the topic we have to know as professional software developers. His book is based on C++11 but refers often to C++17. What I like in particular about the book is: It is not only about the Don’t but also the Dos.
But first things first. Clean C++ has 9 chapters and a short introduction to UML. The first two chapters are programming language agnostic. In the chapters on unit testing and key principles of software development such as (Keep It Simple and Stupid (KISS), You Aren’t Gonna Need It (YAGNI), Don’t Repeat Yourself (DRY), or Principle Of Least Astonishment (PLA), the author talks about evergreens that will hold for sustainable software. The remaining chapters are also about good software practices but more from a C++ perspective. This new point of view starts with the chapter basics. Stephan Roth presents the key principles to write good names, comments, and functions. What has modern C++ to offer? A question that will be answered by the author in the next chapter “Advances Concepts of Modern C++“. C++ has its roots in object orientation but modern C++ becomes more and more dominant by functional concepts. What are the pros and cons of these paradigms? Questions, to which the book provide answers in about 60 pages. Unit-Tests should be used as a basis for Test-Driven Development. This is his focus in the next chapter Test-Driven Development (TDD). He shows in an elaborate example, how you can use TDD to convert Arabic numbers into Roman numerals. The chapter on Design Pattern and Idioms completes the book. One design pattern is very close to Stephan Roth: dependency injection. Dependency injection is the cure to get rid of the heavily discussed singleton anti-pattern. Admittedly he is right.
What makes “Clean C++” such a great book that I will use it as a general recommendation at the end of my seminars? Do not have the cited classics all the important information? Definitely! The book “Clean C++” is from my point of view the only and pragmatic introduction to the topics for good software development in C++ which you can easily consume in one week. If you are done with this introduction, you should dive into more specific topics may they be general or C++ specific. This will keep you busy for the rest of your life as a software developer.
Modernes C++ Mentoring
Do you want to stay informed: Subscribe.
Thanks a lot to my Patreon Supporters: Matt Braun, Roman Postanciuc, Tobias Zindl, G Prvulovic, Reinhold Dröge, Abernitzke, Frank Grimm, Sakib, Broeserl, António Pina, Sergey Agafyin, Андрей Бурмистров, Jake, GS, Lawton Shoemake, Jozo Leko, John Breland, Venkat Nandam, Jose Francisco, Douglas Tinkham, Kuchlong Kuchlong, Robert Blanch, Truels Wissneth, Mario Luoni, Friedrich Huber, lennonli, Pramod Tikare Muralidhara, Peter Ware, Daniel Hufschläger, Alessandro Pezzato, Bob Perry, Satish Vangipuram, Andi Ireland, Richard Ohnemus, Michael Dunsky, Leo Goodstadt, John Wiederhirn, Yacob Cohen-Arazi, Florian Tischler, Robin Furness, Michael Young, Holger Detering, Bernd Mühlhaus, Stephen Kelley, Kyle Dean, Tusar Palauri, Juan Dent, George Liao, Daniel Ceperley, Jon T Hess, Stephen Totten, Wolfgang Fütterer, Matthias Grün, Phillip Diekmann, Ben Atakora, Ann Shatoff, Rob North, Bhavith C Achar, Marco Parri Empoli, Philipp Lenk, Charles-Jianye Chen, Keith Jeffery, Matt Godbolt, and Honey Sukesan.
Thanks, in particular, to Jon Hess, Lakshman, Christian Wittenhorst, Sherhy Pyton, Dendi Suhubdy, Sudhakar Belagurusamy, Richard Sargeant, Rusty Fleming, John Nebel, Mipko, Alicja Kaminska, Slavko Radman, and David Poole.
My special thanks to Embarcadero | |
My special thanks to PVS-Studio | |
My special thanks to Tipi.build | |
My special thanks to Take Up Code | |
My special thanks to SHAVEDYAKS |
Modernes C++ GmbH
Modernes C++ Mentoring (English)
Rainer Grimm
Yalovastraße 20
72108 Rottenburg
Mail: schulung@ModernesCpp.de
Mentoring: www.ModernesCpp.org
Modernes C++ Mentoring,
Leave a Reply
Want to join the discussion?Feel free to contribute!