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:

267

Reviewer:

Frances Buontempo

Reviewed:

July 2024

Rating:

★★★★★


Verdict: Highly Recommended.

I’ve often read parts of Bartek’s blog (https://www.cppstories.com/p/about/) so was delighted to get a review copy of his book about C++ initialisation. Many recent C++ books focus on a specific standard, giving a throughout rundown of all the features introduced. They end up being big books which work well as a reference book, but are hard to read from cover to cover.

Bartek’s book breaks the mould. He walks through various ways to initialize variables in C++. How hard can it be? Well, even though we have the uniform initialization syntax, using {}, there are subtleties. The book starts simply with local objects, progressing to classes and much more besides. Things to consider for construction, destruction, lifetimes rules and template deduction are also included, and the final chapter provides some techniques, such as the copy and swap idiom and the Curiously Recurring Template Pattern (CRTP: see https://en.cppreference.com/w/cpp/language/crtp). There are short quizzes part way through and at the end, and these helped remind me of a few things I had just learnt, so were useful.

The book is well paced, with chapters up to 20 pages or so, arranged in a logical order starting simply and building up. The subtitle is ‘A Guide Through All Initialization Options and Related C++ Areas.’ As well as initialization, he shows where things go wrong if you don’t pay attention to details, and how you might end up making code less efficient by mistake.

People who consider themselves relatively well-versed in C++ will still learn something from this book, while anyone starting out will also find this useful. I knew a lot of what’s included, but learnt many new things or gained a deeper understanding of why certain approaches are better. I will re-read this. Any book that will be read and re-read is definitely 5 stars.

Website: https://leanpub.com/cppinitbook






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.