{"id":1180,"date":"2018-10-25T06:33:27","date_gmt":"2018-10-25T06:33:27","guid":{"rendered":"http:\/\/cppdepend.com\/blog\/?p=1180"},"modified":"2018-10-26T10:33:49","modified_gmt":"2018-10-26T10:33:49","slug":"c-17-in-detail-book-review","status":"publish","type":"post","link":"https:\/\/cppdepend.com\/blog\/c-17-in-detail-book-review\/","title":{"rendered":"C++ 17 In Detail Book Review"},"content":{"rendered":"<p><span style=\"font-weight: 400;\">Since its creation, C++ evolved continuously and it passed many major milestones from the C with classes to the rise of the new standards. From 1991 to 2011 the language evolved slowly and the evolution comes from the libraries like STL and Boost. However, from 2011 many features were added to the standard, thanks to the new standards C++11, C++14, C++17, and the coming C++20.<\/span><!--more--><\/p>\n<p><span style=\"font-weight: 400;\">Recently the C++ community promotes the use of new standards to modernize the existing code base. \u00a0<\/span><a href=\"https:\/\/www.bfilipek.com\/\"><span style=\"font-weight: 400;\">Bart\u0142omiej Filipek<\/span><\/a><span style=\"font-weight: 400;\"> is one of the most active bloggers from the C++ community who contribute to promoting the new standards. He wrote an excellent book about the C++17 standard features. And here\u2019s a quick review of his book.<\/span><\/p>\n<p><b>Pragmatic approach<\/b><\/p>\n<p><span style=\"font-weight: 400;\">In the computer science world, there are many academic books mostly destined to students and there are some other books mainly destined to the developers who need an advice of how to resolve real problems when developing a product. \u00a0You learn by coding, indeed few pages do not contain source code. Every explanation is demonstrated by at least one code sample.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">The code samples are very well formatted, easy to read and clean.<\/span><\/p>\n<p><img decoding=\"async\" src=\"http:\/\/www.cppdepend.com\/img\/bookreview.png\" alt=\"\" \/><\/p>\n<p><span style=\"font-weight: 400;\">Also, the book author gives us much practical info like the compiler support for each feature.<\/span><br \/>\n<img decoding=\"async\" src=\"http:\/\/www.cppdepend.com\/img\/bookreview2.png\" alt=\"\" \/><\/p>\n<p><b>The Whole picture from the beginning:<\/b><\/p>\n<p><span style=\"font-weight: 400;\">In general to have an idea about a book content we can take a look at the index and read the introduction. However, in many cases, it\u2019s not really sufficient to have a clear idea about the goal of the book.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">What\u2019s interesting in this book is that we have a \u201cQuick Overview\u201d section which contains 4 pages and explains clearly the content of the book.<\/span><\/p>\n<p><b>New Language features demystified:<\/b><\/p>\n<p><span style=\"font-weight: 400;\">The book enumerates almost all the new C++17 features grouped by section.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Even if some features are difficult to understand, Bart\u0142omiej Filipek adopts the \u201cKeep it simple\u201d approach and any feature is very well explained using basic samples. For example in the templates new features section which includes:<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Template argument deduction for class templates<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">template&lt;auto&gt;<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Fold expressions<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\"> if constexpr \u2013 the compile-time if for C++! \u2022<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">Plus some smaller, detailed improvements and fixes<\/span><\/li>\n<\/ul>\n<p><span style=\"font-weight: 400;\">You will be impressed by the clarity provided by the explanations and the code samples. Every C++ developer even a beginner one could understand the utility of these new features.<\/span><\/p>\n<p><b>New standards library features demystified<\/b><\/p>\n<p><span style=\"font-weight: 400;\">The good news is that the standard library evolves in each new standard and many new interesting features are added. Here are the C++17 standard library features treated in the book:<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">How to represent nullable types with std::optional.<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">What\u2019s a tagged union? And why we need a type-safe union in the form of std::variant.<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">How to represent any type with std::any.<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">How to use string_view to gain performance and not break your application<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">What are the new string operations available in the Standard Library.<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">How to work with the filesystem using the Standard Library.<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">What are the parallel algorithms.<\/span><\/li>\n<\/ul>\n<p><span style=\"font-weight: 400;\">Each feature is explained in detail using many code samples. \u00a0And what\u2019s interesting is that the author talks also about performance &amp; memory consideration and explains how a feature could impact the performance and memory usage.<\/span><\/p>\n<p><img decoding=\"async\" src=\"http:\/\/www.cppdepend.com\/img\/bookreview3.png\" alt=\"\" \/><\/p>\n<p><b>More samples and uses cases<\/b><\/p>\n<p><span style=\"font-weight: 400;\">At the end of the book, other interesting problems are exposed. The author tries to give many solutions and explains how the new standard resolve them better than the old features.<\/span><\/p>\n<p><b>Conclusion:<\/b><\/p>\n<p><span style=\"font-weight: 400;\">When reading the book it\u2019s clear that the author is a programmer who worked on many C++ projects to resolve real problems. Which explains the pragmatic approach of the book. We recommend this book to each developer who wants to master the new C++17 standard.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">The book is available @Leanpub,\u00a0and as our reader, you can buy it ~15% cheaper\u00a0by using the following coupon link:<\/span><\/p>\n<p><a href=\"https:\/\/leanpub.com\/cpp17indetail\/c\/codergears\"><span style=\"font-weight: 400;\">https:\/\/leanpub.com\/cpp17indetail\/c\/codergears<\/span><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Since its creation, C++ evolved continuously and it passed many major milestones from the C with classes to the rise of the new standards. From 1991 to 2011 the language evolved slowly and the evolution comes from the libraries like STL and Boost. However, from 2011 many features were added to the standard, thanks to &hellip; <a href=\"https:\/\/cppdepend.com\/blog\/c-17-in-detail-book-review\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;C++ 17 In Detail Book Review&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[36,3],"class_list":["post-1180","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-c17","tag-cplusplus"],"_links":{"self":[{"href":"https:\/\/cppdepend.com\/blog\/wp-json\/wp\/v2\/posts\/1180","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/cppdepend.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cppdepend.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cppdepend.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/cppdepend.com\/blog\/wp-json\/wp\/v2\/comments?post=1180"}],"version-history":[{"count":7,"href":"https:\/\/cppdepend.com\/blog\/wp-json\/wp\/v2\/posts\/1180\/revisions"}],"predecessor-version":[{"id":1187,"href":"https:\/\/cppdepend.com\/blog\/wp-json\/wp\/v2\/posts\/1180\/revisions\/1187"}],"wp:attachment":[{"href":"https:\/\/cppdepend.com\/blog\/wp-json\/wp\/v2\/media?parent=1180"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cppdepend.com\/blog\/wp-json\/wp\/v2\/categories?post=1180"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cppdepend.com\/blog\/wp-json\/wp\/v2\/tags?post=1180"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}