Trip Report: CppCon 2014

CppCon 2014 was a blast. It lived up to its goal of being an inclusive event "by the C++ community for the C++ community" -- for the world's top experts and for students, from formal talks to lightning rounds and hallway hacking.

The festival atmosphere went on around the clock all week long, starting with daily 8:00am welcome/lightning talks, through the daily keynotes with live music followed by six tracks of sessions, through to well-attended evening sessions and panels ending at 10:00pm every night with people still lingering, reluctant to leave. All of us were running on little sleep because we didn't want to miss anything, but somehow it didn't seem to matter -- we should have been exhausted, but instead people kept commenting about how we felt energized instead.

It was a week for everyone: Talks and panels featured both established experts and first-time presenters and self-published authors. Session levels ranged from cutting-edge metaprogramming, to Stroustrup's keynote of "Keep Simple Things Simple!" Lightning talks overflowed, then overflowed again. Technical material ranged from modern C++ language topics, to Mars Rover flight control software, to the current hot trend of C++ being adopted as the "write once, target anywhere" language of choice for cross-platform iOS/Android/Mac/Windows apps at Dropbox, Office, Facebook, and more; we'll be sure to hear a lot more about that in the coming months and years.

All week long, advanced developers found themselves able to talk through design questions together with peers they wouldn't have met otherwise, and come up with solutions they couldn't find at home. At the same time, scores of students and other newcomers to C++ enjoyed the broad content and relaxed environment. It's telling that the book that the on-site bookstore kept selling out of was not some esoteric template tome, but Stroustrup's 180-page overview A Tour of C++. The C++ community is growing and inclusive, with lots of advanced folks and also new people, and both CppCon and C++ itself are very much for all of them.

Even top authors and experts broke new ground they wouldn't have been able to do if not face to face. Thanks to discussions at CppCon, it looks like a number of us, including Scott Meyers and Bjarne Stroustrup, are converging on "forwarding references" as the new and better term for "universal references," and confirm the simple default parameter-passing advice for modern C++ (spoiler: same as C++98). See the final slides of my closing plenary session for details on these developments.

As we return home in the afterglow, remember that all sessions were recorded and videos will be posted online in the next month or so. Slide handouts are already mostly posted for your reading pleasure. And CppCon 2015 will be on September 20-25 next year... mark your calendars.

Huge thanks again to the 150+ speakers, planners, and volunteers without whom this wonderful "C++ festival" (as several people spontaneously called it) would not have been possible. I had guardedly high hopes for the event, but I think it exceeded all our expectations. This was the most exciting and enlightening week I've experienced in my 20 years of C++, and I'm still catching my breath. I can't wait until September 2015.

C++14 is Ratified: The View from the June 2014 C++ Standard Meeting -- Michael Wong

An update on C++ standardization from Michael Wong, who is here at CppCon this week.

C++14 is Ratified: The View from the June 2014 C++ Standard Meeting

by Michael Wong

From the article:

We had one C++ Standard meeting since my last blog post for Issaquah Standard meeting, and that was in Rapperswil, Switzerland in June 16-21. ...

As I am writing this (which is much delayed due to workload and preparation for airplane time again as I begin my fall business trip after 2 months home working on a special project), I am back in [the Seattle area] to attend CPPCon giving 2 talks, 3 panels, and several interviews....

Lambda Over Lambda in C++14 -- Chris Kohlhepp

A nice complement to the C++14 lambda article we linked to yesterday:

Lambda Over Lambda in C++14: The Convergence of Modern C++ on the Lisp Programming Style, Part II

by Chris Kohlhepp

From the article:

Let us see how that simplifies under C++14 and generic lambdas.

Three observations are striking immediately:
1) The use case for a template has disappeared entirely. We simply have a generic function argument x. This matches Lisp.

2) The code is now entirely as brief as Lisp. Where Lisp has a lot of parenthesis, this style of coding develops a lot of “autos.”

3) The mechanics are identical also. Both functions are actually named lambdas...

C++14 Lambda Tutorial -- Sol

cpp-lambda-tutorial.PNGBuilding on recent C++11 lambda tutorials we've linked to recently, here's one about the brand-new lambda features in C++14:

C++14 Lambda Tutorial

by Sol

From the article:

The last iteration of C++, C++14 was approved this month. C++14 brings a few much anticipated changes to the C++11 standard, like allowing auto to be used as the return type of a function, or generic lambdas -- the subject of this article...

Introduction to Type Traits in the C++ standard library -- Yvonne Ma

"Are you an enum?" "Are you polymorphic?" The answers to these type questions and more are already in your C++11 standard library:

Introduction to Type Traits in the C++ standard library

by Yvonne Ma

From the article:

... As its name suggests, Type Traits exposes different characteristics of types, or simply the “type of type”. In many C++ programming practices, especially these in template metaprogramming, developers may find it difficult to build a template work for all types without knowing the characteristics of a type. That’s the key reason for the emergence of Type Trait...

C++ Templates series -- Feabhas

Here's a recent series that just got a new instalment today: It introduces template basics in a nicely explained and accessible way suitable for a gentle introduction, and then going on to progressively help the reader develop stronger template muscles.

C++ Templates series

by Feabhas

An Introduction to C++ Templates

Template Classes

Template Inheritance

Templates and Polymorphism

Template Member Functions

Variadic Templates

Templates of Templates

And today: Template Specialization

From the Introduction:

Templates are a very powerful -- but often very confusing -- mechanism within C++. However, approached in stages, templates can be readily understood (despite their heinous syntax).

The aim of this series of articles is to guide beginners through the syntax and semantics of the foundation concepts in C++ template programming.

atoi and itoa conversions in C++11 -- FangLu

All your friends know about C++11's new stoi and to_string, right? If not, here's a quick refresher to share:

atoi and itoa conversions in C++11

by FangLu

The key reminder from the article:

... The atoi and itoa conversions in C are not very satisfying to programmers, because programmers need to deal with invalid input and exceptions to avoid worst case. On the other hand, these functions are straightforward and easy to use. So they are not rare in C++ code...

In C++11, global functions, such as std::to_string, std::stoi/stol/stoll are introduced to implement atoi/itoa conversions conveniently. For example:

string s;

s += to_string(12) + " is int, ";

s += to_string(3.14f) + " is float.";

cout << s << endl;

where to_string can do type conversion according to the parameter type.

Here is another example:

string s("12");

int i = stoi(s);

cout << i << endl;

Fun with Lambdas: C++14 Style (Part 3) -- Sumant Tambe

sumant-tambe.PNGMore rapid-fire "now write this using lambdas" problem-solution drill with Sumant Tambe:

Fun with Lambdas: C++14 Style (Part 3)

by Sumant Tambe

From the article:

Now that we have C++14, it has opened up doors for truly mind-bending uses of lambdas--more specifically--generic lambdas. This blog post is the third installment in the series of "Fun with Lambdas: C++14 Style". Check out part 1 and part 2 if you have not already.

This post is about "monadic tuples"...

CppCon: Call for Lightning Talks, Take 2 -- Boris Kolpackov

CppCon minus one week:

Call for Lightning Talks, Take 2

by Boris Kolpackov

From the announcement:

As part of getting ready to come to CppCon 2014, please consider presenting a Lightning Talk. All attendees (as well as anyone nearby who is taking advantage of the free evening content without registering) are eligible to present a 5 or 15 minute session on Tuesday evening. While the first Call for Lightning Talks has more details on what we’re looking for, we’re open to talks from new speakers, from experienced speakers, from those who work mainly in another language and are visiting C++, from those who work in C++ all the time -- everyone! If there’s one tool you just love using, one technique or best practice you’d like to share with others, or one thing you think is pretty darn funny, please see if you can make it into a 5 or 15 minute talk and share it Tuesday evening. There will be a projector and there will be an audience so why not “give it a go” and see what happens?

We’ll be selecting the 8 sessions on Monday, Day 1 of the conference. Just email [email protected] and tell us what you want to talk about, what length you need and a little bit about yourself -- one sentence is fine. Your topic should be relevant to CppCon attendees but doesn’t need to be about C++ -- we’d love to see “Why C++ developers should also know [language]” for example. Even if you don’t plan to submit, plan to attend, it’s sure to be fun!