Chapter 4. The Beast Roars Back
In this chapter, we’ll discuss a number of C++ resources, most of which are either new or have been revitalized in the last few years. Of course this isn’t an exhaustive list. Google and Amazon are your friends.
Our first topic is the ISO Committee for C++ standardization, which at 25 years old, is hardly a new resource, but it certainly glows with new life. The committee is formally called ISO/IEC JTC1 (Joint Technical Committee 1) / SC22 (Subcommittee 22) / WG21 (Working Group 21).1 Now you know why most people just call it the C++ Standards Committee.
As big an accomplishment as it is to release a new or updated major standard like C++98 or C++11, it doesn’t have much practical impact if there are no tools that implement it. As mentioned earlier, this was a significant issue with the release of the standard in 1998. Committee attendance fell off because implementation was understood to be years away.
But this was not the case for the release in 2011. Tool vendors had been tracking the standard as it was being developed. Although it called for significant changes to both the core language and the standard library, the new update was substantially implemented by a couple of different open source implementations, GCC and Clang, soon after its release.2 Other tool vendors had also demonstrated their commitment to the update. Unlike some language updates,3 this was clearly adopted by the entire community as the path forward.
The psychological impact of this should not be underestimated. Thirteen years is a very long time in the world of programming languages. Some people had begun to think of C++ as an unchanging definition, like chess or Latin. The update changed the perception of C++ from a dying monster of yesteryear into a modern, living creature.
The committee reformulated itself6 to put the new members to the best use. It had long been formed of a set of subcommittees called working groups. There were Core, Library, and Evolution working groups; but with many new members and so many areas in which the industry is asking for standardization, new working groups were the answer. The Committee birthed over a dozen new “Domain Specific Investigation & Development” groups.
The first new product of the committee was a new standard in 2014. C++14 was not as big a change as C++11, but it did significantly improve some of the new features in C++11 by filling in the gaps discovered with real-world experience using these new features.
The target for the next standard release is 2017. The working groups are busy reviewing and developing suggestions that may or may not become part of the next update.
The existence of a vital Standards Committee that is engaged with the language users, tool vendors, and educators is a valuable resource. Actively discussing and debating possible features is a healthy process for the entire community.
In Chapter 6, The Future of C++, we’ll discuss more about the working groups and what they are working on.
Clang is clearly the most significant new development in the C++ toolchain, but the resurgence of interest in C++ has brought more than just Clang to the community. We’ll discuss a few interesting newcomers.
biicode7 is a cross-platform dependency manager that you can use to download, configure, install, and manage publicly available libraries, like the Boost libraries. This is old-hat for other languages, but this is new technology for C++. The site only hit 1.0 in the middle of 2014 and is still in beta, but it has thousands of users and has been growing aggressively.
Undo Software8 has a product called UndoDB, which is a reversible debugger. The idea of a reversible debugger, one that supports stepping backward in time, is so powerful that it has been implemented many times. The problem with previous implementations is that they run so slowly and require so much data collection that they aren’t practical for regular use. Undo has found a way to increase the speed and reduce the data requirements so that the approach is practical for the first time. This product isn’t C++ only, but its marketing is focused on the C++ community.
JetBrains9 has built its reputation on IDEs with strong refactoring features and has over a dozen products for developers. But until launching CLion10 in 2015, it’s not had a C++ product. CLion is a cross-platform IDE for C and C++ with support for biicode. CLion can be used on Windows, but for developers that use Microsoft’s Visual Studio for C++ development, JetBrains is updating ReSharper,11 its VS extension, which supports C#, .NET, and web-development languages to also support C++.
The last tool that we’ll mention isn’t a development tool, but a deployment tool. OSv12 is an operating system written in C++ that is optimized for use in the cloud. By rethinking the requirements of a virtual machine existing in the cloud, Cloudius Systems has created an OS with reduced memory and CPU overhead and lightweight scheduling. Why was this implemented in C++ instead of C? It turns out that gets asked a lot:
While C++ has a deserved reputation for being incredibly complicated, it is also incredibly rich and flexible, and in particular has a very flexible standard library as well as add-on libraries such as boost. This allows OSV code to be much more concise than it would be if it were written in C, while retaining the close-to-the-metal efficiency of C.13
Standard C++ Foundation
Many languages14 are either created by or adopted by a large company that considers the adoption of the language by others a strategic goal and so markets and promotes the language. Although AT&T was supportive of C++,15 it never “marketed” the language to encourage adoption by external developers.
Various tool vendors and publishers have promoted C++ tools or books, but until this decade, no organization16 has marketed C++ itself. This didn’t seem to be an impediment to the growth and acceptance of the language. But in 2010, as the committee was about to release the largest update to the standard since it was created, interest in C++ had noticeably increased. The time seemed ripe for a central place for C++-related information.
At least it seemed like a good idea to Herb Sutter, the Standards Committee’s Convener.17 Sutter wanted to build an organization that would promote C++ and be independent of (but supported by) the players in the C++ community. With their support, he was able to launch the Standard C++ Foundation18 and http://isocpp.org in late 2012.
In addition to serving as a single feed for all C++-related news, the website also became the home for the “C++ Super-FAQ.”19 The Super-FAQ acquired its name because it is the merger of two of the largest FAQs in C++.
Bjarne Stroustrup, as the language’s creator, was the target of countless, often repetitive questions, so he had created a large FAQ on his personal website.20
The moderators of the Usenet group comp.lang.c++ were also maintaining a FAQ21 for C++. In 1994, Addison-Wesley published this as “C++ Faqs” by moderators Marshall Cline and Greg Lomow. In 1998, Cline and Lomow were joined by Mike Girou with the second edition,22 which covered the then recently released standard.
Both of these FAQs have been maintained online separately for years, but with the launch of http://isocpp.org, it was clearly time to merge them. The merged FAQ is in the form of a wiki so that the community can comment and make improvements.
Today isocpp.org is the home not only to the best source of news about the C++ community and the Super-FAQ, but also has a list of upcoming events, some “getting started” help for people new to C++, a list of free compilers,23 a list of local C++ user groups,24 a list of tweets,25 recent C++ questions from Stack Overflow, information about the Standards Committee and the standards process, including statuses, upcoming meetings,26 and links for discussion forums by working group.27
Boost: A Library and Organization
As described earlier, Boost was created to host free, open source, peer-reviewed libraries that may or may not be candidates for standardization. Boost has grown to include over 125 libraries,28 is the most used C++ library outside of the standard library, and it has been the single best source of libraries accepted into the standard since its inception in 1998.
The Boost libraries and boost.org have become the center of the Boost community, which is made up of the volunteers who have developed, documented, reviewed, maintained, and distributed the libraries.
Since 2005, Boost as an organization has regularly participated in the Google Summer of Code program, giving students an opportunity to learn cutting-edge C++ library development skills.29
Since 2006, Boost has gathered for an intimate, week-long annual conference, originally called BoostCon. More about this later.
Recently, Robert Ramey, a Boost library author, has built the Boost Library Incubator30 to help C++ programmers produce Boost-quality libraries. The incubator offers advice and support for authors and provides interested parties with the opportunity to examine code and documentation of candidate libraries and leave comments and reviews. There are currently over 20 libraries31 in the incubator, all open to reviews and/or comments.
C++ is an amazing tool for building high-quality libraries and frameworks, so while the 125+ libraries in Boost are the most distributed (other than the standard library), they only scratch the surface of the libraries and frameworks available for C++. There are publicly available lists of libraries on Wikipedia32 and cppreference.com.33
The Internet revolution has changed the practical experience of writing code in any language. The combination of powerful public search engines and websites with reference material and thousands of questions and answers dramatically reduces the time lag between needing an answer about a particular language feature, library call, or programming technique, and finding that answer.
The impact is disproportionately large for languages that are very complicated, have a large user base (and therefore lots of online resources) or, like C++, both. Here are some online resources that C++ programmers have found useful.
Nate Kohl noticed that there were some sites with useful references for other languages,34 so in 2000, he launched cppreference.com.35 Initially he posted documentation as static content that he maintained himself. From the beginning, there were some contributions from across the Internet, but in 2008, the contribution interest was too much to be manageable, so he converted the site to a wiki.
Kohl’s approach is to start with high-level descriptions and present increasing detail that people can get into if they happen to be interested. His theory is that examples are more useful to people trying to solve a problem quickly than rigorous formal descriptions.
The wiki has the delightful feature that all the examples are compilable right there on the website. You can modify the example and then run it to see the result. Right there on the wiki!
As useful as documentation and examples are, some people learn better in a question-and-answer format. In 2008, Stack Overflow36 launched as a resource for programmers to get their questions answered. Stack Overflow allows users to submit questions about all kinds of programming topics and currently contains over 300,000 answered questions on C++.
In order for a Q&A site to be useful, it needs to provide a good way to find the question you are looking for, and high-quality answers. Your favorite Internet search engine does pretty well with Stack Overflow, and the answers tend to be of high quality. Post a question, and it might be answered by Jonathan Wakely, Howard Hinnant, James McNellis, Dietmar Kühl, Sebastian Redl, Anthony Williams, Eric Niebler, or Marshall Clow. These are the people that have built the libraries you are asking about.
As useful as a Q&A site like Stack Overflow is, some people feel more comfortable in a more traditional forum environment. Alex Allain, who wrote the book Jumping into C++ [JIC] has built cprogramming.com37 into a community site of its own with references, tutorials, book reviews, tips, problems, quizes, and several forums.
As you’d expect of a language with a large user base, there are a lot of Internet hangouts for learning about and discussing C++. There are dozens of blogs41 and an active subreddit.42 Jens Weller maintains a blog at Meeting C++ called Blogroll that is a weekly list of the latest C++ blogs.43
A special mention goes to the freenode.net ##C++ IRC channel, members
of which are known for mercilessly tearing apart every snippet of code you might
care to show them. Funny how harsh critique makes good programmers. They also
take care of the channel’s pet,
geordi, the friendliest C++ evaluation bot
the world has ever known.
Conferences and Groups
Throughout the 2000s, the market for conference-going C++ programmers was largely served by SD West in the US and ACCU in Europe. Neither conference was explicitly for C++, but both attracted a lot of C++ developers and content.
Beginning in 2010 and for every year since, Andrei Alexandrescu, Scott Meyers, and Herb Sutter have worked together to produce C++ and Beyond.44 They’ve described it as a “conference-like event” rather than a conference. We won’t quibble. These are three-speaker, three-day events with advanced presentations by the authors of some the most successful books on C++.45 Registration is limited46 to provide for more speaker-audience interaction. Most attendees have over a decade of C++ experience, are well informed about programming in C++, and value the opportunity for informal discussions with the speakers.
In 2006, Dave Abrahams and Beman Dawes started BoostCon, which was designed to allow the Boost community to meet face to face and discuss ideas with each other and users. The intention was for content to be Boost Library-related, but serve a wider audience than just the Boost Library developers. Over time, the content became a little more mainstream, but it always focused on cutting-edge library development, and attendance was never greater than 100.
While at BoostCon in May, 2011, Jon Kalb47 approached the conference planning committee with the idea of making BoostCon more mainstream. He argued that BoostCon, while small, was very successful and had the potential to be the mainstream C++ conference of North America. Kalb proposed that BoostCon change its name to something with C++ in it, add a third track, and grow the number of attendees. He pointed out that by the next conference (May 2012), the new standard update would be released, and there would be a lot of demand for sessions on C++11. The new track could be entirely made up of C++11 tutorials. The planning committee accepted the ideas, and C++Now was born. Something must have been in the air, because C++Now was only one of three new C++ conferences in 2012.
Late in 2011, Microsoft announced the first GoingNative conference for February 2012, about three months before the first C++Now. This conference was different from C++Now in a number of ways, but was the same in one important way.
Despite the fact that it was produced (and subsidized) by Microsoft, the content was entirely about portable, standard C++. It was larger, with probably about four times as many attendees as BoostCon. It was shorter, lasting two days as opposed to a week. GoingNative sessions were professionally live-streamed to the world, instead of the “in-house” video recording done at BoostCon/C++Now. Instead of multiple tracks with sessions by speakers from across the community, GoingNative had a single track filled entirely with “headliners.” Almost all of the GoingNative 2012 speakers either had been BoostCon keynote speakers or would be later be C++Now keynoters.
C++Now 2012 had three tracks,48 including one that was a C++11 tutorial track. Conference attendance jumped to 135 from 85 the previous year.
Jens Weller, inspired by attending C++Now, decided to create a similar conference for Europe in his home country of Germany. The first Meeting C++ conference49 was held in late 2012, and at 150 attendees, it was larger in its first year than C++Now.
Weller has been an active C++ evangelist,50 and Meeting C++ has continued to grow. It is now at four tracks and is expecting 400 attendees in 2015. Weller’s influence has extended beyond the Meeting C++ conference. He has launched and is supporting several local Meeting C++ user groups across Europe.51
The list of C++ user groups52 includes groups in South America as well as North America and Europe.
C++Now 2013 reached the registration limit that planners had set at 150. The Boost Steering Committee decided that instead of continuing to grow the conference, it would cap attendance at 150 indefinitely. After this decision was announced, Chandler Carruth, treasurer of the Standard C++ Foundation, spoke with Kalb about launching a new conference under the auspices of the foundation.
Later, Carruth and Kalb would pitch this to Herb Sutter, the foundation’s chair and president. He was instantly on board, and CppCon was born. The first CppCon attracted almost 600 attendees to Bellevue, Washington in September of 2014. It had six tracks featuring 80 speakers, 100 sessions, and a house band. One of the ambitious goals of CppCon is to be the platform for discussion about C++ across the entire community. To further that goal, the conference had its sessions professionally recorded and edited so that over 100 hours of high-quality C++ lectures are freely available.53
The CppCon session videos supplement an amazing amount of high-quality video content on C++. Most of the C++ conferences mentioned earlier have posted some or all of their sessions online free. The BoostCon YouTube channel54 has sessions from both BoostCon and C++Now. Both Meeting C++55 and CppCon56 have YouTube channels as well.
Channel 9, Microsoft’s developer information channel, makes its videos available in a wide variety of formats, including audio-only for listening on the go. In addition to hosting the CppCon videos,57 some sessions from C++ and Beyond in 201158 and 2012,59 all of the sessions of the two GoingNative conferences in 201260 and 2013,61 and a number of other videos on C++,62 Channel 9 also has a series on C++ that is called C9::GoingNative.63
Although there are lots of C++ videos, there is relatively little audio.66 This follows from the fact that when discussing C++, we almost always want to look at code, which doesn’t work well with just audio. But audio does work for interviews, and Rob Irving has launched CppCast,67 the only podcast dedicated to C++.
There are hundreds of books on C++, but in an era of instant Internet access to thousands of technical sites and videos of almost every subjects, publishing tech books is not the business that it once was, so the number of books with coverage of the 2011 and/or 2014 releases is not large.
We should make the point that because of the backward compatibility of standard updates, most of the information in classic C++ books is still largely valid. For example, consider what Scott Meyers has said about his classic book Effective C++ 68
Whether you’re programming in “traditional” C++, “new” C++, or some combination of the two, then, the information and advice in this book should serve you well, both now and in the future.69
Still, using a quality book that is written with the current standard in mind gives you confidence that there isn’t a better way to do something. Here are a few classic C++ books that have new editions updated to C++11 or C++14:
Bjarne Stroustrup has new editions of two of his books. Programming: Principles and Practice Using C++, 2nd Edition [PPPUC] is a college-level textbook for teaching programming that just happens to use C++. He has also updated his classic The C++ Programming Language [TCPL] with a fourth edition. The overview portion of this book is available separately as A Tour of C++ [ATOC], a draft of which can be read online free at isocpp.org.70
Nicolai Josuttis has released a second edition of his classic, The C++ Standard Library: A Tutorial and Reference [TCSL], which covers C++11.
Barbara Moo has updated the C++ Primer [CP] to a fifth edition that covers C++11. The primer is a gentler introduction to C++ than The C++ Programming Language.
Here are a couple of books that are new, not updates of classic C++ versions:
Scott Meyers’ Effective Modern C++: 42 Specific Ways to Improve Your Use of C++11 and C++14 [EMC] was one of the most eagerly awaited books in the community. An awful lot of today’s C++ programmers feel like the Effective C++ series was a formative part of our C++ education, and we’ve wanted to know for a long time what Scott’s take on the new standard would be. Now we can find out.
Unlike the previously mentioned books, Anthony Williams’ C++ Concurrency in Action: Practical Multithreading [CCIA] is not about C++ generally, but just focuses on the new concurrency features introduced in C++11. The author is truly a concurrency expert. Williams has been the maintainer of the Boost Thread library since 2006, and is the developer of the just::thread implementation of the C++11 thread library. He also authored many of the papers that were the basis of the thread library in the standard.
2 Note the weasel words “substantially” and “soon.” Complete and bug-free implementations of every feature aren’t the point here. The crux is that the community recognized that C++11 was a real thing and the need to get on board right away.
3 We are looking at you, Python 3.0.
4 Or, in the case of some features, preceded.
5 The meeting where a new standard is officially voted to be a release is always highly attended. The first few meetings after that did see a bit of a drop, but soon the upward trend was clear.
16 The only central organization for C++ was the Standards Committee, but promoting the language was outside of its charter (and resources).
17 “Convener” is ISO speak for committee chair.
21 The concept and term “FAQ” was invented by Usenet group moderators.
34 Such as Sun’s early Java API reference site.
45 And D.
46 The registration limit has varied from 60 to 120, depending on the venue. The 2010 event was so popular an “encore” event was held a couple of months later.
47 The same.
48 BoostCon always had two tracks. Initially, the plan was that one track was for Boost Library developers and the other for users. Over time this distinction was lost, but the conference continued to have two tracks.
53 After publishing the videos on YouTube, the conference received requests for an alternative from developers in countries where YouTube is blocked. So the conference asked Microsoft’s Channel 9 to host them as well.
66 Although Channel 9 content is available as audio-only, this tends to work well only for panels and interviews.