Video available: Sean Parent, "Better Code: Data Structures" -- CppCon 2015 Wednesday keynote

parent-cppcon15-v.PNGThe wonderful week of CppCon 2015 has just concluded, and we now have the Wednesday keynote video available below. (Reminder: All the sessions, panels, and lightning talks are being professionally recorded and will be available online worldwide for free. Like last year, expect them about a month after the conference ends. We're making a special effort to make the daily keynote/plenary sessions available early.)

Here it is:

Better Code: Data Structures (YouTube)

by Sean Parent, CppCon 2015 day 3 keynote

The standard library containers are often both misused and underused. Instead of creating new containers, applications are often structured with incidental data structures composed of objects referencing other object. This talk looks at some of the ways the standard containers can be better utilized and how creating (or using non-standard library) containers can greatly simplify code. The goal is no incidental data structures.

Related (other CppCon 2015 videos posted early):

We hope posting these few highlights during and shortly following CppCon can help to let everyone in the worldwide C++ community share in the news and feel a part of the gathering here in the Seattle neighborhood this week. Even if you couldn't be here in person this year to enjoy the full around-the-clock technical program and festival atmosphere, we hope you enjoy this nugget in the video presentation.

Bitesize Modern C++ : noexcept--Glennan Carnie

What is the use of noexcept?

Bitesize Modern C++ : noexcept

by Glennan Carnie

From the article:

We have some basic problems when trying to define error management in C:

  • There is no “standard” way of reporting errors. Each company / project / programmer has a different approach
  • Given the basic approaches, you cannot guarantee the error will be acted upon.
  • There are difficulties with error propagation; particularly with nested calls.

The C++ exception mechanism gives us a facility to deal with run-time errors or fault conditions that make further execution of a program meaningless...

Video available: Herb Sutter, "Writing Good C++14 by Default" -- CppCon 2015 day 2 plenary session

sutter-cppcon15-v.PNGCppCon is in full swing, and once again all the sessions, panels, and lightning talks are being professionally recorded and will be available online worldwide for free. Like last year, expect them about a month after the conference ends.

This year the team is trying to get a few of the big talks up early while still busily recording the 100+ others still in progress. Yesterday, they posted Bjarne Stroustrup's opening keynote video less than 48 hours after the live talk, and we're pleased to see that as of this writing over 10,000 of you have already enjoyed it online in its first day!

Today, the team posted the video for Herb Sutter's Day 2 plenary talk, which he described as "part 2 of Bjarne's keynote" with a focus on type and memory safety with live demos. If you couldn't be at CppCon on Tuesday in person, we hope you enjoy it:

Writing Good C++14... by Default (YouTube) (slides)

by Herb Sutter, CppCon 2015 day 2 plenary session

This talk continues from Bjarne Stroustrup’s Monday keynote to describe how the open C++ core guidelines project is the cornerstone of a broader effort to promote modern C++. Using the same cross-platform effort Stroustrup described, this talk shows how to enable programmers write production-quality C++ code that is, among other benefits, type-safe and memory-safe by default -- free of most classes of type errors, bounds errors, and leak/dangling errors -- and still exemplary, efficient, and fully modern C++.

Related:

We hope posting these few highlights while CppCon is still in progress can help to let everyone in the worldwide C++ community share in the news and feel a part of the gathering here in the Seattle neighborhood this week. Even if you couldn't be here in person this year to enjoy the full around-the-clock technical program and festival atmosphere, we hope you enjoy this nugget in the video presentation.

Video available: Bjarne Stroustrup, "Writing Good C++14" -- CppCon 2015 opening keynote

stroustrup-cppcon2015-v.jpgCppCon is in full swing, and once again all the sessions, panels, and lightning talks are being professionally recorded and will be available online -- about a month after the conference, because it takes time to process over 100 talks!

However, because of the importance of Bjarne's open keynote announcements on Monday, the team has pulled out the stops to process his video and get it up on YouTube (and maybe soon also Channel 9 for areas where YouTube is not available). It's there now, so if you couldn't be at CppCon on Monday in person, check it out:

Writing Good C++14 (YouTube) (slides)

by Bjarne Stroustrup, CppCon 2015 opening keynote

Related: Bjarne Stroustrup announces C++ Core Guidelines

The team says that they may also fast-track the other daily keynote/plenary sessions as well, some of which are directly related to Bjarne's keynote. If that happens, we'll post links here too. In the meantime, enjoy Bjarne's groundbreaking talk -- as one CppCon attendee and longtime C++-er said, "this is one of the most exciting weeks for C++ I can remember." We agree.

Bjarne Stroustrup announces C++ Core Guidelines

This morning in his opening keynote at CppCon, Bjarne Stroustrup announced the C++ Core Guidelines (github.com/isocpp/CppCoreGuidelines), the start of a new open source project on GitHub to build modern authoritative guidelines for writing C++ code. The guidelines are designed to be modern, machine-enforceable wherever possible, and open to contributions and forking so that organizations can easily incorporate them into their own corporate coding guidelines.

The initial primary authors and maintainers are Bjarne Stroustrup and Herb Sutter, and the guidelines so far were developed with contributions from experts at CERN, Microsoft, Morgan Stanley, and several other organizations. The guidelines are currently in a “0.6” state, and contributions are welcome. As Stroustrup said: “We need help!”

Stroustrup said: “You can write C++ programs that are statically type safe and have no resource leaks. You can do that without loss of performance and without limiting C++’s expressive power. This supports the general thesis that garbage collection is neither necessary nor sufficient for quality software. Our core C++ guidelines makes such code simpler to write than older styles of C++ and the safety can be validated by tools that should soon be available as open source.”

From Stroustrup’s talk abstract:

In this talk, I describe a style of guidelines that can be deployed to help most C++ programmers... The rules are prescriptive rather than merely sets of prohibitions, and about much more than code layout... The core guidelines and a guideline support library reference implementation will be open source projects freely available on all major platforms (initially, GCC, Clang, and Microsoft).

Although the repository was not officially announced until today, it was made public last week and was noticed: CppCoreGuidelines was the #1 trending repository worldwide on GitHub on Friday, and is currently the #1 trending repository worldwide for the past week, across all languages and projects.

Stroustrup also announced two other related projects.

Guideline Support Library (GSL): First, the C++ Core Guidelines also specifies a small Guideline Support Library (GSL), a set of common types like array_view and not_null to facilitate following the modern guidelines. An initial open source reference implementation contributed and supported by Microsoft is now available on GitHub at github.com/Microsoft/GSL. It is written in portable C++ that should work on any modern compiler and platform, and has been tested on Clang/LLVM 3.6 and GCC 5.1 for Linux, with Xcode and GCC 5.2.0 for OS X, and with Microsoft Visual C++ 2013 (Update 5) and 2015 for Windows. This is both a supported library and an initial reference implementation; other implementations by other vendors are encouraged, as are forks of and contributions to this implementation.

Checker tool: Second, the C++ Core Guidelines are designed to be machine-enforceable wherever possible, and include many rules that can be checked by a compiler, lint, or other tool. An initial implementation based on Microsoft’s Visual Studio will be demonstrated in several talks at CppCon this week, including Herb Sutter’s Day 2 plenary session tomorrow morning. This implementation will be made available as a Windows binary in October, with the intention to open source the implementation thereafter. This too will become a supported tool and an initial reference implementation open to others; other implementations by other vendors of compilers, linters, and other tools are encouraged.

A number of other CppCon talks will go deeper into the related topics, notably the following talks by speakers who collaborated on the Guidelines effort:

Herb Sutter: Writing Good C++14 by Default (Tue 10:30am)

Gabriel Dos Reis: Large Scale C++ with Modules: What You Should Know (Tue 2:00pm)

Neil MacIntosh: More Than Lint: Modern Static Analysis for C++ (Wed 2pm)

Neil MacIntosh: A Few Good Types: Evolving array_view and string_view for Safe C++ Code (Wed 3:15pm)

Gabriel Dos Reis: Contracts for Dependable C++ (Wed 4:45pm)

Eric Niebler: Ranges and the Future of the STL (Fri 10:30am)

(and more)

If you’re at CppCon this week, watch for those talks. If you aren’t, like last year’s event, CppCon 2015 is again professionally recording all talks, and they will be freely available online about a month after the conference.
 

The Visual C++ team is at CppCon 2015 by Eric Battalio

CppCon 2015 starts in two hours:

The Visual C++ team is at CppCon 2015

by Eric Battalio

From the article:

Steve Carroll and Ayman Shoukry cover what's new in VC++ early on Thursday morning. Ankit Asthana and Marc Gregoire will update us on the [Clang-based] support for cross-platform mobile development in VS 2015... James Radigan will talk about the work that we're doing to connect the Clang front end to the Microsoft optimizing back end [and] how we're working with the community to make this possible... Gabriel Dos Reis will talk about C++ Modules, a new design that helps with componentization, isolation from macros, scalable build, and support for modern semantics-aware developer tools. ...

Stephan T. Lavavej will discuss developments in <functional> from C++11 to C++17. We'll hear about contracts from Gabriel Dos Reis, and ... Artur Laksberg goes into the details of the Concurrency TS while Gor Nishanov describes the exciting future of concurrency in C++: coroutines, an abstraction that makes your code both simpler and execute faster. ...

You might have noticed a new repo that the Standard C++ Foundation published last week: the C++ Core Guidelines... Bjarne will talk about this in his keynote on Monday morning, and Herb Sutter will continue the discussion with his talk on Tuesday. And we've not only been working on the guidelines: we've implemented a library to support the guidelines and enforcement tools that automatically verify that your code follows them. Neil MacIntosh will discuss both of these projects in his back-to-back talks on Wednesday afternoon. The C++ Core Guidelines are a huge step forward for the language and the Visual C++ team is excited to be part of the group working on bringing them to reality!

C++ Core Guidelines -- Bjarne Stroustrup, Herb Sutter

Bjarne Stroustrup and Herb Sutter are currently editing the newly created C++ Core Guidelines on GitHub. 

C++ Core Guidelines

From the abstract section of the page:

This document is a set of guidelines for using C++ well. The aim of this document is to help people to use modern C++ effectively. By "modern C++" we mean C++11 and C++14 (and soon C++17). In other words, what would you like your code to look like in 5 years' time, given that you can start now? In 10 years' time?

The guidelines are focused on relatively higher-level issues, such as interfaces, resource management, memory management, and concurrency. Such rules affect application architecture and library design. Following the rules will lead to code that is statically type safe, has no resource leaks, and catches many more programming logic errors than is common in code today. And it will run fast - you can afford to do things right.

We are less concerned with low-level issues, such as naming conventions and indentation style. However, no topic that can help a programmer is out of bounds.

Our initial set of rules emphasize safety (of various forms) and simplicity. They may very well be too strict. We expect to have to introduce more exceptions to better accommodate real-world needs. We also need more rules.

You will find some of the rules contrary to your expectations or even contrary to your experience. If we haven't suggested you change your coding style in any way, we have failed! Please try to verify or disprove rules! In particular, we'd really like to have some of our rules backed up with measurements or better examples.

You will find some of the rules obvious or even trivial. Please remember that one purpose of a guideline is to help someone who is less experienced or coming from a different background or language to get up to speed.

The rules are designed to be supported by an analysis tool. Violations of rules will be flagged with references (or links) to the relevant rule. We do not expect you to memorize all the rules before trying to write code.

The rules are meant for gradual introduction into a code base. We plan to build tools for that and hope others will too.

Comments and suggestions for improvements are most welcome. We plan to modify and extend this document as our understanding improves and the language and the set of available libraries improve.

 

CppCon 2014 Unicode in C++--James McNellis

Have you registered for CppCon 2015 in September? Don’t delay – Registration is open now.

While we wait for this year’s event, we’re featuring videos of some of the 100+ talks from CppCon 2014 for you to enjoy. Here is today’s feature:

Unicode in C++

by James McNellis

(watch on YouTube) (watch on Channel 9)

Summary of the talk:

In some programming languages, text processing is easy. Unfortunately, C++ is not one of those languages. C++ lacks good, built-in support for Unicode, though the situation is starting to improve.

This session will begin with a brief overview of text encodings, and an introduction to Unicode and the various Unicode encodings. We'll look at the woeful state of Unicode support in C++98 (or, really, lack thereof), then take a look at the improvements that were made in C++11 and other improvements that have recently been proposed for standardization. We'll finish up with a discussion of several libraries designed to make it easier to work with Unicode in C++, including the widely-used, open-source International Components for Unicode (ICU) library.