Tuesday, November 1, 2011

C++11 Training Materials Updated

Now that C++0x has become C++11, I updated the name of my training materials and released the latest revision to past buyers. This marks the third updated release of these materials since their original publication in April 2010.

Updating notes for a multiple-day training course (such as my three-day C++11 seminar) has an interesting constraint:  unless the changes involve adding or removing full days worth of material, the length of the course can't be changed.  For a topic like C++11, where I'm learning more all the time, this means that I sometimes want to add information without changing the length of the class.  One way I do that is by adding comments below the PowerPoint slides.  The comments don't get shown in class, but they elaborate on material in the slides.

For the most recent materials update, one of the ways I took advantage of this was by taking the following bullet point from a list of "Other Features" in C++11 (that the course doesn't really cover, typically because the features are less important or because there's currently little or no compiler support for them):
  • Contextual keywords for alignment control, preventing derivation, and constraining virtual function overrides.
I added the following elaboration in the comments:
The identifiers override and final are contextual keywords. Both classes and virtual functions may be declared final. final classes may not be used as bases (per 9/3), and final virtual functions may not be overridden in derived classes.  A virtual function declared override must override a function in a base class. The following is an amalgam of examples from 10.3/4-5:
struct B {
    virtual void f() const final;
    virtual void f(int);
};
struct D : B {
    void f() const;                      // error: D::f attempts to override final B::f
    void f(long) override;             // error: wrong signature overriding B::f
    void f(int) override;               // OK
};
Because elaborations like this generally don't get presented in class, this means that the information in the training materials is in some ways more comprehensive than the information I deliver during a presentation. On the other hand, during a live presentation, people can ask about whatever they want, so I typically address a variety of topics that aren't in the training materials at all.

To the best of my knowledge, my training materials are currently the best source of accessible information about C++11. The Internet is filled with pages about C++11, but many of them were written at a time when draft C++0x was still in a state of flux, and unless you already know the details of the final version of C++11, it's hard to judge whether what you read on a given page is up to date.  The final C++11 standard is definitive, of course, but it's currently expensive (about US$400 at the ISO store), and I don't think anybody will tell you it's easy to read or understand.  There is, as far as I know, only one book out that covers C++11, and although I have not read it, given its recent publication date, I'd be surprised if it takes into account the very latest changes that took place during standardization. (I'd hoped to link to this book, which I know about only from a press release, but now I can't find it. If you know which book it is -- or of other books currently available that cover C++11 -- please let me know.)

To be frank, my training materials aren't perfectly up to date, either.  I had hoped that they were, but it's a big standard (1353 pages), and just yesterday I received a set of bug reports from a member of the standardization committee pointing out places where my notes' treatment of some parts of C++11 are out of sync with the final standard.  I'll fix those problems in the next release of the training materials, a release that, like all releases, will be automatically pushed out to anybody who has purchased the materials.

If you're interested in a book-like publication covering the most important parts of C++11 (both language and library), I encourage you to consider purchasing my training materials.  If you like my other publications, I think you'll like these, too.  To see exactly what you'll be getting, check out the free sample.

Because this publication is in an unconventional format (annotated training materials), is available from a lesser-known publisher (Artima), and is electronic-only (DRM-free PDF), getting the word out about it has been challenging.  I'd appreciate it if you'd let people know about it, whether through blogs, tweets, social networks (the politically correct term for Facebook), email, or that most retro of communications mechanisms, face-to-face conversation.

Thanks,

Scott

Monday, October 24, 2011

C++11 Discussion with me, Herb Sutter, and Andrei Alexandrescu

One of the panel sessions at C++ and Beyond 2011 in August was devoted to C++11, the new standard for C++. That panel session is now live.  I hope you find it interesting.

Scott

Tuesday, September 20, 2011

"Final" C++11 Feature Availability Summary Updated

Since "freezing" my C++11 Feature Availability Summary about a month ago (per this post), I've had a couple of people point me to Stephan T. Lavavej's unbelievably detailed blog post summarizing C++11 feature availability in Visual C++ 11 (as well as VC10), plus I came across Michael Wong's corresponding post for C++11 support in xlC++, so I decided that I froze only the feature tables in my C++11 support summary.  I'll continue to update my links to sources summarizing C++11 feature support in various compilers, because that's not a lot of work for me, and I think the information is useful.  You'll find those links on the first page of my feature availability summary.

Enjoy the ever-burgeoning compiler support for C++11!

Scott

Thursday, August 25, 2011

Video Interview with me, Herb Sutter, and Andrei Alexandrescu

Immediately after the conclusion of C++ and Beyond on August 10, Charles Torre from Microsoft's Channel 9 rounded up me, Herb Sutter, and Andrei Alexandrescu for an hour-long discussion of a variety of issues related to, well, C++ and beyond.  That interview is now live, and I hope you enjoy it.

Scott

Tuesday, August 16, 2011

C++11 Feature Availability Spreadsheet Updated

Now that C++ and Beyond 2011 is behind me, C++0x has been officially christened C++11 (or, as I like to think of it, "C++:  The Spinal Tap Edition"), and Stephan T. Lavavej pointed me to his unbelievably easy to download and install binary of gcc 4.6 for Windows, I had time to play with gcc 4.6 and update my C++11 feature availability summary (now rechristened to reflect that "C++0x" is terminologically passé).  Once again I found myself cackling with glee as I successfully built and ran programs with wacky stuff like
constexpr int factorial(int n) noexcept {                 // define constexpr function!
  return (n == 1) ? 1 : (n * factorial(n-1));
}

std::array<int, factorial(5)> a;                          // use it!
and
for (auto i : { 1, 2, 3, 4, 5} ) std::cout << i << " ";   // range-based for!
I mean, really, who can't love that?   More complicated stuff works, too, like defaulting and deleting and automatically generating move operations.  And nullptr (already present in VC10) joins the party, too. Fun, fun, fun. 

Because C++11 is no longer a draft standard (even if there are still some bureaucratic levers to be moved) and compiler support for C++11 is increasingly common, there's no need for me to keep updating the feature availability summary, so, modulo bugs in the existing data (I'll fix those as they're brought to my attention), I'm freezing it as is.  That will give me more time to play around with the newly-minted and schnazzed up C++, and that's a lot more rewarding than putting little letters in boxes on a spreadsheet.

Have fun with C++11.  How can you not?

Scott

Monday, July 11, 2011

Only 10 Seats Left at C&B next month

Next month's C++ and Beyond is nearly sold out;  there are only 10 spots left.  Registration runs until the end of the month, but only if we don't sell out first, which seems likely.  If you've been thinking about registering for three highly technical days with Herb Sutter, Andrei Alexandrescu, me, and about 100 of the most experienced and insightful C++ developers on the planet (registrations have already come in from three continents), I encourage you to do it while you still can.

I'm especially looking forward to hearing Herb talk about taking advantage of GPUs' computational capabilities in general-purpose programs, and I suspect that Andrei's talk on Big Data will reflect the fact that he and his colleagues have hallway conversations that include offhand comments like, "it's taking too long to create a hash table with four billion elements."  In the meantime, I'm working on the materials for my talk on the C++0x memory model, and my research is showing that, pretty much as expected, there are some interesting subtlties very much worth exploring.  And that's only a third of the technical program!

I'm also looking forward to hanging out and talking with those ~100 experienced and insightful developers, because they -- you -- collectively comprise a gold mine of information.  Plus they -- you -- work on really interesting problems.  And you're all just so darn nice, too.

I hope to see you in Banff next month!

Scott

Sunday, June 5, 2011

C&B Early Bird Registration Expires Friday!

Early Bird registration (and, more importantly, the $300 per person discount that goes along with it) expires at the end of this week (i.e., at the end of the day on Friday, 10 June) for C++ & Beyond 2011, so if you've been thinking about joining Andrei Alexandrescu, Herb Sutter, and me in Banff in August to talk about topics such as programming GPGPUs, the C++0x memory model, processing BIG data, and more, be sure to sign up by the end of the week!

Scott

Sunday, May 8, 2011

Presentation Materials from ACCU Talks Now Available

Silly me. When I posted about the availability of videos of my ACCU talks, I forgot to also make available the presentation materials for those talks, even though in the talks I say I'll send copies to anybody who asks me for them.  Let's skip the you asking me and me sending them to you, okay?  Instead, just download them directly:
Scott

Wednesday, May 4, 2011

Blog posts now reflected to Twitter

If you're interested in knowing about new posts to this blog, but your preferred notification mechanism is twitter, you'll be pleased to know that I've set up a twitter account, and I've arranged for blog posts here to be reflected there. This is, at least for the time being, the only use I plan to make of twitter.

At twitter, I'm @Scott__Meyers, i.e., http://twitter.com/Scott__Meyers.

Scott

Tuesday, May 3, 2011

Videos from ACCU Talks Now Available

The fine folks behind the 2011 ACCU Conference recorded my technical presentations, and those videos are now online as follows:
Viewing these videos is the next best thing to having been to the sessions, provided your definition of the next best thing includes having a seat at the extreme left end of Row 1. The video is nothing to tweet home about (especially if you want to read the text on the slides), but the audio is quite nice. One thing you're likely to find attractive is that the way the video is exposed, I'm hidden much of the time.

Enjoy!

Scott

Monday, May 2, 2011

Updated C++0x Training Materials Published

In April of last year, I announced the publication of my training materials on C++0x.  In trying to win your interest, I wrote:
In some ways, they're better than a book. They make more extensive use of color, they "cut out the fat" to focus on the technical essentials, and my licensing terms grant buyers unlimited updates for life: as long as I update the materials, buyers are entitled to a revised version for free.
I published updates last May and August, but I decided to hold off on publishing additional revisions until C++0x had settled down.  With ratification of the FDIS in March, that settling has occurred, so I've updated my training materials to correspond to the essentially-final draft standard.  The revised version of my materials also includes all the modifications I've made based on my experience using them for professional training purposes, so the latest incarnation should be both the most accurate ever as well as the clearest and most useful.

If you've purchased a copy of the materials, you should already have received notification from Artima Press on how to download the latest PDF. If you haven't purchased a copy, but you've been thinking you'd like to learn more about C++0x, maybe this is the time to give my materials a try.  You can download the first ~25 pages as a free sample at the materials' sales page.

I hope you find these revised materials on C++0x useful.

Scott

Monday, April 25, 2011

C&B Talk on Perfect Forwarding

I've just posted a description of another presentation I'll be making at C++ & Beyond to the C&B blog.  Like all the other talks at C&B, it's of the all-new, world-debut variety.  The title is Adventures in Perfect Forwarding, and following the link will take you to the blog entry that will tell you all about it.

I continue to hope to see you in Banff in August.

Scott

Tuesday, April 12, 2011

C&B Talk on C++0x Memory Model

Herb Sutter, Andrei Alexandrescu, and I are in the process of fleshing out the technical program for this year's C++ & Beyond, and I've just posted my first session announcement.  The title is "The C++0x Memory Model and Why You Care," and rather than repeat the talk description here, I'll let you follow the link to the C&B blog entry for the details.  This will be a new talk I'm creating specifically for C&B, and it should cover topics of interest to anybody who cares about multithreaded programming under C++0x.

The other C&B talks that have been so far announced are:
I think this year's C&B is shaping up to offer an exceptionally strong set of technical talks, and I hope to see you in Banff in August.

Scott

Saturday, April 2, 2011

Appearing/Disappearing consts Article now at C++Next

Shortly after I posted about DDJ publishing and then "unpublishing" my article on appearing and disappearing consts, Eric Niebler suggested I publish it at C++Next. I was pleased to get the offer.  C++Next is emerging as a premier site for C++-related articles, and, unlike some other publishers I could mention, it doesn't demand exclusive worldwide rights to the content it publishes, nor does it insist on "the right in [its] sole and exclusive discretion to edit, rewrite, condense, abridge, or otherwise change" what I wrote. (In fairness, that last part was followed by "taking care, of course, not to change your meaning," but my experience is that the most appropriate person to retain sole and exclusive discretion over what I mean is me.)

Eric volunteered to do the hard work of taking my article and preparing it for publication at C++Next, and then, in a stunning departure from some other publishers I could mention, he worked with me as I tweaked things here and there for final publication.  The result is the best version of the article that exists, both in terms of content and presentation.

I'm grateful to Eric and also to Dave Abrahams, both of whom were instrumental in helping me publish this article in its current form.  In an era when anybody can publish anything with a few mouse clicks, it's a pleasure to work with people who remain dedicated to the hard and detailed work of making content available that's useful to readers and satisfying for authors. Even more than usual, any shortcomings that remain in the article are my fault, because Eric and Dave bent over backwards to accommodate my requests.

Scott

Saturday, March 26, 2011

Effective C++ in the C++0x (C++11) Age

Yesterday, Herb Sutter posted the truly exciting news that the new version of C++ has reached FDIS status.  Practically (though not officially) speaking, this means that the new standard for C++ is finished, and we can stop using the code name "C++0x" and start using "C++11" in its place.

I was recently informed that the German translation of Effective C++ will be reissued with a new cover as part of their "classics" series.  They asked me to write a little something about it, and I came up with a new preface that considers the relevance of the information in the book in the age of C++0x/C++11.  Given the adoption of the FDIS, plus the fact that the preface will be published only in translation, it seems appropriate to post it here:
2011 is an exciting year for C++ developers. It marks the official debut of the new standard for C++, informally known as “C++0x”. Over a dozen years in the making, C++0x makes C++ more powerful and flexible than ever. In addition to introducing major new features, such as support for concurrency, lambda expressions, move semantics, and type deduction for variables (auto variables), C++0x provides an assortment of secondary capabilities that also increase expressiveness, improve efficiency, and eliminate programming drudgework. Examples include range-based for loops, static assertions, inheriting and delegating constructors, reference-counting smart pointers, hash tables, regular expressions, variadic templates, and more. All told, the C++0x feature set is about twice that of “old” C++. Furthermore, the feature set is increasingly real: the number of C++0x features supported by modern compilers is large and growing quickly. 2011 isn't just the year when C++0x receives official ratification as a new standard, it's also the year in which it starts to see serious mainstream use.

Which may lead you to wonder whether the information and advice in this pre-C++0x edition of Effective C++ remains relevant. I'm pleased to report that it does. Surprisingly so, in fact. Having spent nearly two years steeped in the details of C++0x, I expected to groan a bit as I reviewed this book's table of contents with C++0x in mind. Surely some Items would be inappropriate. But the advice I found proved sound. Should C++0x developers prefer consts, enums, and inlines to #defines (Item 2)? They should. Should they prevent exceptions from leaving destructors (Item 8)? Certainly. Should they use objects to manage resources? Declare data members private? Consider alternatives to virtual functions? Factor parameter-independent code out of templates? (Items 13, 22, 35, and 44.) Yes, yes, yes, yes! My goal has always been for Effective C++'s table of contents to summarize the advice in the book, and that summary remains just as applicable to C++0x development as to “traditional” C++ development. C++0x is a bigger language, and in some ways it's a different one, but the core techniques for making effective use of “old” C++ are core for the effective use of C++0x, too.

This doesn't mean that this Effective C++ is a perfect match for C++0x. The book doesn't discuss features new to C++0x, so Items about making effective use of those features are missing. A C++0xified Effective C++ would certainly have Items devoted to move operations, to uniform initialization, and to lambda expressions, and it'd probably have an entire chapter on making effective use of the concurrency API. Such a book would also contain different examples, e.g., ones making use of auto variables, range-based for loops, in-class default initializers, as well as the occasional variadic template. To the extent that this book falls short in its support for C++0x, the errors are those of omission, not commission.

But Effective C++ has never claimed to be a comprehensive book. My intent has never been for it to address every aspect of the language. Rather, it has been to examine the most important aspects of C++ that affect practicing programmers on a day-to-day basis. C++0x introduces new aspects of the language that warrant discussion, but that doesn't diminish the importance of the issues I treat in this book. In fact, it may accentuate them, because effectiveness with C++0x requires mastery of the language it extends, i.e, “old” C++. As the shiny new parts of C++0x garner more and more attention, discussion of the “old” parts will recede, but those parts will still be important.

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.

Friday, March 25, 2011

C++ and Beyond 2010 Presentation Materials Now Available

The official presentation materials from last year's C++ and Beyond event that I did with Herb Sutter and Andrei Alexandrescu are now available for purchase.  For the full story, please consult my post at the C++ and Beyond web site.

Scott

Monday, March 21, 2011

Neuer Schulungskurs: Effektives C++ im eingebetteten Bereich

Seit 1999 habe ich mit der Firma QA Systems daran gearbeitet, technische Seminare in Mitteleuropa (hauptsächlich in Deutschland, normalerweise im Herbst) zu halten. Wir haben versucht, fast jedes Jahr etwas Neues anzubieten. Bis zu diesem Jahr hat „etwas Neues“ immer neue Themen bedeutet, und in den letzten Jahren ist es fast voraussehbar geworden, dass die Weltpremieren meiner neuen Seminare in Deutschland stattfinden. So war es mit meinem Seminar über C++0x in 2009 und mit dem über Fastware in 2010. Für 2011 wollen wir auch etwas Neues haben, aber dieses Jahr ist es kein neues Thema. Stattdessen ist es ein bewährtes Thema – die effektive Anwendung von C++ im eingebetteten Bereich – in einer neuen Sprache: Deutsch.

Wir finden, dass es ständig Interesse an diesem Thema in Deutschland gibt, und wir glauben, dass einige Ingenieure die Informationen lieber in ihrer Muttersprache erfahren würden, auch wenn der Referent (ich) mit einem komischen Akzent spricht. Der Inhalt des Kurses ist gleich wie die ursprüngliche englische Version („Effective C++ in an Embedded Environment“), aber alles ist auf Deutsch: der Vortrag, die Folien, die Unterlagen, die Fragen und Antworten – alles.

Ich kann nicht behaupten, dass ich Deutsch so gut spreche wie  Englisch (schön wär's!), aber QA Systems und ich denken, dass wir dieses Jahr eine gute Gelegenheit anbieten, nützliche, verlässliche Informationen über die Anwendung von C++ im eingebetteten Bereich auf Deutsch zu bekommen. Wenn Sie sich für dieses Thema interessieren, empfehle ich Ihnen, dass Sie die Beschreibung des Kurses auf der QA Systems Website anschauen.  (Dort wird der alternative Titel "Effective C++ in einer Embedded Umgebung" verwendet.)

Ich hoffe, Sie bei diesem Seminar im Oktober in Stuttgart kennenzulernen.

Scott

Talks in Stuttgart in October

For the dozenth year in a row, I'll be collaborating with QA Systems on a series of one- and two-day technical seminars in Germany in the fall.  (Okay, the first year the seminars were in Switzerland, and, yes, I am aware that Switzerland is not part of Germany.)  This year's talks are:
If the title of the second seminar looks a little funny, that's probably because you're expecting it to be in English.  It's not.  Like the entire seminar, it's in German.  I'll post details about that in a separate posting that will follow this one, although I'll note here that I didn't choose the rather Denglish title above.  The title I use is "Effektives C++ im eingebetteten Bereich."

The seminars with QA Systems are always a lot of fun, with very sharp attendees asking really interesting questions.  I hope to see you at one or more of the talks I'll be giving in Stuttgart in October.

Scott

Monday, March 14, 2011

Registration for C++ and Beyond 2011 is now open!

Herb Sutter, Andrei Alexandrescu, and I will be doing an all-new C++ and Beyond in August in Banff, and registration has just opened.  If you're intrigued by the notion of getting together with some of the most interesting and experienced C++ developers on the planet, discussing how to take advantage of new C++0x language features, and exploring how to attack challenging performance problems, C++ and Beyond is an event I think you'll find worthy of your attention.  I encourage you to check out the C++ and Beyond web site for everything there is to know about the event.

Most of my posts related to C++ and Beyond go to the C&B blog, so if you'd like to follow developments related to C&B, I suggest you subscribe to its feed.

I hope to see you at C&B 2011 in Banff in August!

Scott

Wednesday, March 9, 2011

Appearing and Disappearing Articles at DDJ

The article I mentioned in my last post ("Appearing and Disappearing consts in C++") is no longer available at the URLs I provided.  In fact, it's not available at the Dr. Dobb's web site at all.  However, the PDF I submitted to DDJ is available through this link, where it will remain. The rest of this post explains why the article briefly flickered to life at DDJ and then vanished. Unless your interest in C++ extends to the process of getting something about it published, you can skip the information that follows.

I can't speak for other authors, but the way I've always worked with publishers on articles can be summarized this way:
  1. I send the prospective publisher an idea for an article, a rough draft of an article, or an essentially complete article, and I ask if they are interested in publishing it. If so, we move to step 2.
  2. We negotiate a contract for the article.  Generally speaking, I grant them certain publication rights, and they agree to pay me something for them.
  3. I deliver a final version of the article, which they then convert into whatever format will be published.
  4. They ask me to review the converted article to ensure that no errors were introduced during conversion.
  5. The article is published.
In this case, DDJ went directly from step 1 to step 5 after agreeing to publish the article, something they were able to do, because I'd submitted an essentially final manuscript, thus eliminating the need to wait for me to deliver the final copy in step 3. I found out about the publication from a friend of mine some hours after the bits went live.

I contacted DDJ and expressed my concern that they had published without our agreeing on a contract or my being given a chance to review the article for errors.  They sent a proposed contract, and I requested changes.  We went back and forth a couple of times.  They eventually decided that we would be unable to come to agreement, so they removed the article from their site.  I found out about this when somebody posted a comment to that effect to my blog, although DDJ sent official notice some time later.

As an aside, the contract negotiations didn't get hung up on money.  It was more about the kinds of rights DDJ would acquire and who'd have control over the content of the article.

 I'm sorry about the confusion about the article's location, but at least we can enjoy the irony of an article about appearing and disappearing consts itself appearing, disappearing, and now reappearing.  I still  hope you find the article interesting and useful.

Scott

Tuesday, March 8, 2011

New Article: "Appearing and Disappearing consts in C++"

It's been a couple of years since I got the itch to write a technical article, but I recently found myself thinking about types in C++ and how the language sometimes adds or removes const without your explicitly asking it to do so.  This is especially the case when it comes to new features in C++0x such as decltype and lambda expressions.  The result is "Appearing and Disappearing consts in C++" at Dr. Dobbs.  The normal online version of the article is available here, but I think the formatting they use makes it difficult to read, so I suggest you view the printer-formatted version of the article instead. 

I hope you find the article interesting and the information in it useful.

Scott

Monday, January 24, 2011

Caches and Move Semantics at ACCU in April

I'll be giving two talks at the ACCU Conference in Oxford, England, in April:
The ACCU Conference has a great reputation, and based on my experience there last time, I can pretty much guarantee an event that's both technically solid and extremely entertaining. I hope to see you there!

Scott

Tuesday, January 4, 2011

New Training Course: "Fastware for C++"

I've been working intermittently on a book to be called Fastware!  for the past few years. (You can find information about it at its web site.) That project is currently on the back burner, because I ran into two difficulties.  First, I realized that the scope of the project -- encompassing topics in hardware, systems design, concurrency (both thread-based and distributed), algorithms, data structures, tools for improving performance, and more -- was not only going to be impossible to fit within 300 pages, it was also probably beyond my ability to fully comprehend.  Second, the fact that the book was to be language-independent meant that I'd be unable to push my technical treatments down to the level of detail that I and my readers are accustomed to.

These challenges interfered with my work on the book, but they did nothing to diminish my interest in the production of low-latency software systems, so I decided that a reasonable alternative approach was to take my long-established High-Performance C++ Programming training course, update it to acknowledge the emergence of compilers supporting features from C++0x, and expand it to include selected performance topics beyond C++ and its standard library. The result is a new two-day training course that draws heavily on my original vision for Fastware! while still assuming that C++ is the implementation language:  Fastware for C++.

Fastware for C++ covers hard-core C++ performance-related information such as how to avoid the creation of unnecessary objects and how to use the STL efficiently, but it also covers the impact of CPU caches on data structure and algorithm design, the need to optimize the performance of code you don't control (e.g., third-party libraries), commonly-available concurrent algorithms and data structures modeled on the STL, build-time optimization via profile-guided and whole-program analyses, and more. For details, consult the course's web page, and if you're interested in technical training on low-latency software systems in C++, I hope you'll keep it in mind.

Scott