Journal Articles

CVu Journal Vol 32, #1 - March 2020 + Programming Topics
Browse in : All > Journals > CVu > 321 (11)
All > Topics > Programming (877)
Any of these categories - All of these categories

Note: when you create a new publication type, the articles module will automatically use the templates user-display-[publicationtype].xt and user-summary-[publicationtype].xt. If those templates do not exist when you try to preview or display a new article, you'll get this warning :-) Please place your own templates in themes/yourtheme/modules/articles . The templates will get the extension .xt there.

Title: Reviews

Author: Bob Schmidt

Date: 02 March 2020 22:05:45 +00:00 or Mon, 02 March 2020 22:05:45 +00:00

Summary: The latest roundup of reviews.

Body: 

We are always happy to receive reviews of anything that may be of use, or of interest, to software developers. The emphasis will tend to be on technical books, but we are also interested in less-technical works – for example, the humanities or fiction – and in media other than traditional print books.

Do you know of something you think deserves – or does not deserve – a wider audience? Share it here. We're keen to highlight differing opinions on the same work, so if you disagree with a review here do send in your own! Contact Ian Bruntlett at reviews@accu.org.

C++17 In Detail

By Bartlomiej Filipek, published by Leanpub, 2019 (continuous updates), 378 pages, ISBN: 978-1798834060

Reviewed by Paul Floyd

This book is available with continuous updates: https://leanpub.com/cpp17indetail

Highly recommended

C++17 is the second iteration following a three year cycle and at the end of last year (2019) we started getting some books specific to C++17. I felt that C++14 got fairly thin coverage in the publishing world (Programming Principles and Practice, Effective Modern C++ and that’s about it). C++17 seems to be doing better, with second editions of C++ Templates, A Tour of C++ and C++ Concurrency in Action already. Perhaps authors and publishers are having a harder time keeping up with C++ versions? Perhaps also there’s more to write about in C++17.

Getting back to the book itself, the book covers only the new features of C++17. You will need to have to have a good understanding of C++ to be able to get much benefit from the book. The first example on page 3 illustrates several new features. If you are not familiar with std::map, brace initialisation, auto and range based for then you won’t appreciate how much is new.

The book is broken down into three parts: language, library and use cases. There is plenty of information in each chapter on the C++ Standards Committee papers, where the various changes were proposed, and also of which compilers and versions support each feature. The first few chapters cover some fairly basic items that clean up and simplify the language. I expect that Python programmers will appreciate the new Structured Bindings. Chapter 5 Templates (including fold expressions and ‘if constexpr’). In my opinion these are the most important changes in C++17 (especially ‘if constexpr’) which continue the process of enabling easier and more powerful template programming. The language part ends with a chapter on attributes.

The second part covers the library. The first three items – std::optional, std::variant and std::any – have been with us for some time in boost::guise. It’s good to see these in the library and I think that they will be very useful tools. I likes the coverage of performance and exceptions, and there are also summaries of changes from the boost::versions.

The next three chapters are dedicated to strings: std::string_view, string conversions and string searching. Searching isn’t really up my street, but it’s always good to know. string_view and the conversions look promising, at least from a performance perspective. I had already heard some misgivings about the risks of using string_view, and that is well covered. The next two chapters are big items: Filesystem and Parallel Algorithms. There is a lot to cover for filesystems, but everything is covered albeit briefly, and there are a few decent examples of using the interface. Parallel Algorithms is mostly about performance. A little niggle here, I would have liked to see some more useful example for the uses of std::reduce/std::transform_reduce, for instance the variance with an explanation of why std::reduce is not suitable for such calculations. There is a fair amount of performance analysis. The last two chapters of Part 2 cover small items and standard library cleanup.

The last part is a brief overview of some use cases. The first three are refactoring using optional/variant, [[nodiscard]] and if constexpr. The last example parallelises a CSV file reader.

I enjoyed reading the book. It is concise enough that I could read it all in a few days whilst at the same time giving enough coverage that I had a clear impression of the new additions to C++17.

C++17 The Complete Guide

By Nicolai M. Josuttis, published by Leanpub, 2019, 454 pages, ISBN: 978-3967300178

Reviewed by Paul Floyd

The book is available with continuous updates: https://leanpub.com/cpp17

Highly recommended

One of the most difficult aspects with this book is that it is similar to C++17 In Detail by Bartlomiej Filipek. If you are asking yourself “Which one should I get?”, then I’m afraid that I’m not going to be much help as my usual answer to such a question is to buy both. This book is slightly longer and a bit denser.

This book only covers the ‘deltas’ that C++17 has added to (and to a small extent subtracted from) the prior C++ standards. This means that you will need to have a good working knowledge of C++03/11/14 in order to read and benefit from this book.

There are six sections to the book: basic language, template features, new and changed library components, expert utilities and finally general hints. Each section is divided into chapters of around 10 pages (a bit longer for features that require a lot of details like ‘filesystem’). The overall style is mostly descriptive text with annotated snippets. There are some longer examples of runnable code, for instance a mallinfo-style allocator tracker for new and delete. I won’t go into detail on all of the 35 chapters (the table of contents can be seen on the book’s Leanpub web page). Suffice it to say that I felt that there is a good amount of coverage on all of the topics.

One little thing that I felt could have been added is a brief word on compiler/standard library/platform support. I’d like to play around with the parallel algorithms a bit, but only some compiler/library/platform combinations support them currently.

Notes: 

More fields may be available via dynamicdata ..