Wednesday, December 17, 2014

The Evolving Search for Effective C++

The video of my keynote address at Meeting C++ 2014 on December 5 has just been posted to the Meeting C++ Channel at YouTube. I was given a long time slot (two hours), so I addressed two rather different topics, both based on my work of the past quarter century identifying and promulgating guidelines for effective C++ programming.

The meat of the first topic is an explanation of how one of the guidelines in Effective Modern C++--"Consider emplacement instead of insertion"--came to have the form that it does. It has a lot of hard-core C++ content, though I hope that the secondary lesson about the importance of seeking feedback on prospective programming guidance also comes through. This part of the talk runs about an hour.

The second topic is about disseminating information in written and presentation form, and it's not about C++ at all. Rather, it's about issues I think authors, publishers, and trainers need to consider when packaging technical information for consumption in an age where writing is in print or digital form and where the reach of a technical talk is often much greater in recorded form than through a live presentation. This part of the video is about 30 minutes long.

At the end of the talk is some 20 minutes of Q&A.

I worked hard preparing this presentation, and I'm pleased with the way it came out and with the material I covered. I hope you enjoy it.



Anonymous said...

Are you going to publish the slides?

Scott Meyers said...

@Anonymous: I sent the slides to Meeting C++, so I assume they'll make them available someplace. If not, let me know, and I'll post them at my site.

Anonymous said...

Nice talk! But there is /another/ reason why you can't just use emplace_back instead of push_back everywhere: emplace_back uses imperfect forwarding.

Forwarding is imperfect because there's a host of argument kinds that do not forward transparently, such 0 as a null pointer, initializer lists, addresses of function templates or overloaded functions, and rvalue uses of definition-less static constants.

So you can't use emplace_back with any of these. :)

Anonymous said...

Oh, and access control may also prevent emplace_back from calling the constructor you would need it to call.

Scott Meyers said...

@Anonymous: You're right, of course, about the cases where emplacement can't be used. In my talk (and the corresponding book Item), I'm interested in the cases where both insertion and emplacement will compile, so you have to choose between them. When one compiles and one doesn't, it's not too hard to figure out which one to use :-)

Regarding the limitations of perfect forwarding, Item 30 in Effective Modern C++ is devoted to that topic. (A newsgroup post with much of the same information is available here.)

Creat said...

Thank you very much for this talk, it was quite informative. The only comment I have concerns possible alternatives for laser pointers and the like: It's quite simple, but just having line numbers on your slides (yes, like it's the 80s) can help refer to pieces of code without the need of actually pointing to it (physically or digitally), it doesn't require preparation to point to certain items (like pre-highlighting snippets with boxes) and it can even be used by the audience when asking questions.

Scott Meyers said...

@Creat: The idea of line numbering is a good one, thanks. It's not perfect, because sometimes you want to refer to a part of a line (part of an expression, for example), but it's a simple approach with a lot of value.

Anonymous said...

There is another statue in the city Magnitogorsk. It shows the passing of the sword from the maker to the warrior. Obviously, the statue means the creation of the weapon.
The statue in Volgograd has the raised sword. It means the using of the weapon.
The statue in Berlin has the lowered sword. It means peace.
P.S. Thank you for your books.

Scott Meyers said...

@Anonymous: Thanks for the insight into the sword story.

Vipul Chawathe said...

Publishers must get authors agree to make out of print works available, through their online archives for future research scholars, free as knowledge is divine. The book when circulating in print should count as fundraising effort towards maintaining the archives, otherwise one can be picky & self publish too.
As for presentation content appearance, this blog's skin feels like( irritates as) blogger/ BlogSpot advertisement, with the favicon & all, though I only see it outside the comfort of my reader if I want to get back with reply. Its hard to acknowledge your response by just starring/ upvoting it, forcing to carry the thread on & on. Most of Blogger/BlogSpot's own free modern theme templates are sweeter than even the older paid ones.
XSLT/GRDDL allows fast switching amongst online formats, so one may reuse the library customized while writing previous stuff while composing new stuff. That's superior than having one root format like pdf. Multiple formats compose ePub specification, so right from the first electronic composition, every XSLT application should produce predictable result. PERL6 grammars can serve it as web content through xQuery backend like Sedna/ Berkeley.

DavidP said...

I organized a technical workshop and recorded it, and I appreciated your comments about video recordings. If you create an Effective Presentations for Multiple Formats (like your Effective Effective Books list), it would be good to add your practice of repeating questions that weren't made by mic.

Unknown said...

I enjoyed both parts of the presentation very much. I've given up on trying to read technical books in the Kindle format due to limitations in the Kindle technology for representing anything complicated.

Even basic texts often don't render well because Kindle has no capability to do hyphenation. Two long words on a single line often lead to jagged right hand edges. Knuth's famous hyphenation algorithm has been in the wild for 30+ years, you'd think they could just use that.

I don't think Amazon really cares about improving the Kindle format to better support device independent rendering or to support more complicated layouts. They don't bother to police the market to make sure publishers are producing quality Kindle editions.

My favorite Kindle faux pas? One book I bought was presented in Kindle format with scanned images of the printed book. Some of the pages were even crooked!

Saurabh Kusekar said...
This comment has been removed by a blog administrator.