REVIEW - C++ Initialization Story - A Guide Through All Initialization Options and Related C++ Areas


Title:

C++ Initialization Story

A Guide Through All Initialization Options and Related C++ Areas

Author:

Bartłomiej Filipek

Publisher:

Leanpub (2023)

Pages:

274

Reviewer:

Ian Bruntlett

Reviewed:

September 2025

Rating:

★★★★★


Highly recommended.

I have been reading this book on and off for a good while now and have finally made my way through the final chapters. It could have been subtitled ‘All you wanted to know about C++ Initialisation but were afraid to ask’. As books go, this is a ‘details’ book, covering initialisation – but isn’t suited for novices. Most readers will be on a spectrum, from a complete novice to a language expert. My place on that spectrum is ‘can write a simple class with special member functions and dabbles with other languages’. I have watched YouTube videos on C++ Initialisation but my understanding is that they complement this book rather than replace it. Nicolai Josuttis did a CppCon 2018 talk on this, ‘The Nightmare of Initialization in C++’ [1]. If your subject title reads like a Call of Cthulhu scenario, you know you are in for an interesting time.

The downside of being a details book is that there is a lot of jargon. In the case of initialisation, I found that the names used for the differing types of initialisation were so similar that remembering them became a game all on its own. A glossary would have been very helpful – so much so, that in its absence, I started making notes in the inside covers. A quick reference sheet would be an ideal improvement to this book.

There are a lot of code examples in this book. The author thoughtfully provides them on his GitHub page – unfortunately he uses a lot of spaces in his directories and filenames, making life difficult for anyone using the code on Linux. I ended up writing a programme to write two shell scripts to change all the spaces to underscores and some makefiles as well. To test the reader’s knowledge, there are two quiz chapters, with answers provided in an appendix. To further the reader’s knowledge, there is a ‘References’ section.

In Appendix A, the author covers ‘Rules for Special Member Function Generation’. Its reproduction of Howard Hinnant’s diagram misses out the original’s axis titles of ‘Compiler implicitly declares’ and ‘User declares’. For the uncertain reader, this can be off putting – watching Howard Hinnant’s talk on the subject [2] would be a good idea, given those circumstances – as can his article [3].

This book is available as a physical book and an e-book. The physical book is ideal for jumping around in and making notes. The e-book can be more convenient as the URLs for Compiler Explorer, Wandbox, etc aren’t visible on the printed page. Perhaps the author could make a page on his website. [4]

To conclude, the author knows a lot about this topic and has reproduced his knowledge in this book: I expect to dip into it again in the future. The downside is the author is so enamoured with detail that it can be difficult to tell the fundamentals that should definitely be absorbed from the details. If you are interested in this topic, then this book is a worthwhile investment.

Website: https://leanpub.com/cppinitbook

Code site: https://github.com/fenbf/cppinitbook_public/tree/main/examples

References

[1] Nicolai Josuttis, CppCon 2018, ‘The Nightmare of Initialization in C++’, https://youtu.be/7DTlWPgX6zs

[2] Howard Hinnant, ‘Everything you wanted to know about move semantics’ https://youtu.be/vLinb2fgkHk

[3] Howard Hinnant, ‘How I Declare My class And Why’, https://howardhinnant.github.io/classdecl.html

[4] https://www.cppstories.com






Your Privacy

By clicking "Accept Non-Essential Cookies" you agree ACCU can store non-essential cookies on your device and disclose information in accordance with our Privacy Policy and Cookie Policy.

Current Setting: Non-Essential Cookies REJECTED


By clicking "Include Third Party Content" you agree ACCU can forward your IP address to third-party sites (such as YouTube) to enhance the information presented on this site, and that third-party sites may store cookies on your device.

Current Setting: Third Party Content EXCLUDED



Settings can be changed at any time from the Cookie Policy page.