Saturday, June 16, 2018

Minor Change to Blog Charter

Until today, this blog has been about "Scott Meyers' Professional Activities and Interests." I've just removed the "Professional," so now the blog is about "Scott Meyers' Activities and Interests." In theory, this means I can now blog about anything, though in practice, you're unlikely to notice much change. I'm not planning anything dramatic. In fact, I'm not planning anything at all. I just thought it'd be a good idea to relax the blog's thematic constraints.


Monday, June 11, 2018

Interesting Book: The Modern C++ Challenge

I recently became aware of a nifty new book about C++, The Modern C++ Challenge. Today I saw that the ebook is available for $10, which strikes me as quite the bargain.

Before I tell you why I think the book is interesting, let me dispense with some caveats. First, I haven't read the entire book, I've only looked at parts of it. Second, I haven't looked closely enough at the source code to evaluate it. (Because the book uses some C++17 features and my involvement with C++ ended with C++14, I wouldn't really be able to fairly evaluate it, anyway.) Finally, I got the book for free when Packt sent me a (digital) copy.

Two things struck me when I looked inside the book:
  • The "Modern" in The Modern C++ Challenge is as modern as you can get: C++17 (with the occasional mention of C++20).  To run the solutions to the problems in the book, you'll need a C++17-conformant compiler.
  • The "C++" in The Modern C++ Challenge is broader than just the language proper and its standard library. The list of software used by the book includes over a dozen third-party cross-platform libraries, including Boost, Asio, Crypto++, Curl, NLohmann/json, PDF-Writer, PNGWriter, pugixml, SQLite, and ZipLib.
The book itself consists of a series of programming problems ("challenges") and sample solutions. Some are simple, such as Problem 1:
Write a program that calculates and prints the sum of all the natural numbers divisible by either 3 or 5, up to a given limit entered by the user.
Others are more difficult, such as Problem 22:
Write a small library that enables expressing temperatures in the three most used scales, Celsius, Fahrenheit, and Kelvin, and converting between them. The library must enable you to write temperature literals in all these scales, such as 36.5_deg for Celsius, 97.7_f for Fahrenheit, and 309.65_K for Kelvin; perform operations with these values; and convert between them.
All in all, there are 100 problems in a variety of areas, including string processing, dates and time, concurrency, cryptography, and networking.

Because the book isn't afraid to lean on third-party libraries, some of the problems ask you do to things that the standard library can't touch. For example, here's the last problem in the book:
Write a program that can identify people's faces from pictures. At a minimum, the program must detect the face area and the gender of the person. This information should be printed to the console. The pictures must be loaded from the disk.
Wow. Unless there have been big changes to the STL since C++14, there's no "gender_from_image" functionality in the standard library. I wouldn't know where to start. The book's solution begins with some really useful information:
This is yet another problem that can be solved using Microsoft Cognitive Services. One of the services available in this group, called Face API, provides algorithms for detecting faces, gender, age, emotion, and various face landmarks and attributes, as well as the ability to find face similarities, identify people, group pictures based on visual faces similarities, and others.
This is representative of what I view as a strength of the book: the ability to introduce you to libraries and APIs beyond standard C++ that you may not be familiar with. I think that's an important contribution to C++ and its effective application, and between that and the use of features new to C++17, I think it makes the book worth looking into.

The Modern C++ Challenge is currently available for ten bucks for the digital versions of the book and for $35 for the digital and print combo platter. I think that's very reasonable pricing, and, no, I don't get anything for encouraging you to look at the book, nor do I get a kickback of any kind on sales. I just think the book looks really interesting.


Thursday, May 31, 2018

CppCon Workshop on Giving Good Technical Presentations

On Sunday, September 23 (the day before the official beginning of CppCon), Andrei Alexandrescu and Kate Gregory and I will be leading a workshop on how to give good technical presentations. Between the three of us, we've made hundreds (thousands?) of presentations on countless topics to pretty much every kind of audience. We certainly don't know everything that works (or doesn't), but we know some things, and we're eager to share what we've learned.

The workshop is really three workshops in one. Most of the day will be spent in breakout sessions, with Kate, Andrei and me each running a session in our own way. Each workshop participant will spend one breakout with each of us.  The details will vary, but each session will feature a short presentation by each workshop participant, so if you're part of the workshop, by the end of the day, you'll have received personalized suggestions from each of us on what you did well and what we think would help you do better.

For details about the workshop, consult its web page.

This is an interactive workshop, so attendance is limited. Half the slots have been set aside for the conference to offer to first-time CppCon speakers. The other half are open to anyone who wants to improve their technical presentation skills. If that includes you, I encourage you to sign up for the workshop.


Wednesday, May 16, 2018

Effective Modern C++ in Simplified Chinese!

In mid-2015, I was told that translations of Effective Modern C++ into both traditional and simplified Chinese had been authorized. About a year later, the traditional translation showed up on my doorstop (as I noted here). It's been nearly two more years, but the other shoe has finally dropped: EMC++ is now available in simplified Chinese.

Like the original English edition of the book (but unlike most translations), the simplified Chinese version uses multiple ink colors. Readers should thus benefit from the information that conveys.

I'm pleased to welcome this translation into the Effective Modern C++ family. In theory, this makes the information in it accessible to over a billion additional people, so I'll be looking for O'Reilly to find a way to sell it to nearly all of them :-) If you'd like to be a customer, I'm told the place to buy the book--or at least a place to buy it--is here.


Saturday, May 5, 2018

New ESDS Book: More Effective C#, Second Edition

Addison-Wesley released Bill Wagner's new edition of More Effective C# last August, but I didn't find out about it and get a copy until a few days ago. The series editor is always the last to know!

If you're a C# programmer, I encourage you to give the book a close look. It's easy to do that, because Bill and Addison-Wesley have made unusually generous excerpts available at the book's web site (in the "Sample Content" tab): Chapter 2 (16 Items) is available as a freely-downloadable PDF, and Chapter 3 (8 Items) is available online. Together, that's nearly half the book you can read before you put down any money!