Wednesday, February 13, 2013

One of the most important reality checks I use to evaluate material I'm thinking about publishing is to use it in a training setting. Present a prospective guideline to a gaggle of professional C++ software developers, and you find out pretty quickly whether it comprises useful and practical advice. A prospective guideline I have for Effective C++11 is

Declare overriding functions override.

I've drafted training slides for this guideline, and I'd like you to take a look and let me know what you think. (Links are at the end of this post.)

I don't normally ask for public feedback on material in the form of training slides, but in this case, I'd like to know what you think about some formatting decisions I'm in the process of making. I don't want to put a lot of effort into a manuscript only to find out later that I botched my choice of formatting options.

For over a decade, I've used a proportional font for my code examples.
Such a font uses differing widths for different characters. An "m" is
much wider than an "i", for example. This has the advantage that I can
get a lot more characters on a line, which is important when I'm trying
to shoehorn commented code into pages or columns of relatively narrow
width. It has the disadvantage that most programmers use a fixed-pitch
font (one where all the characters are the same width), so the code I
publish doesn't look like what they see in their daily work. In
the example I'm making available, I'm using a fixed-pitch font, e.g.:

In a proportional font, it would look like this:

For a more extensive example of code in a proportional font, take a look at my C++11 training materials sample. Question #1: Do you have a preference which is used in the technical material you read?

Whenever I've had multiple colors for code at my disposal, I've used blue for "normal" code and red as a highlight color (see "const" in the code examples above). Setting aside the specific color choices (which have drawbacks, both for color-blind readers and when printed on monochrome printers), the key point is that I've used two colors for code. An obvious alternative is use multiple colors to syntax-highlight the code, then find another means to highlight important sections. One approach is to mimic highlighting pens by using yellow as a background color. This is what was done with my Universal References article at isocpp.org:

Another approach is to use bold face to indicate highlighted code sections. Here's that approach applied to the first code fragment I showed above:

Question #2: What approach to code coloring do you prefer?

One color for "normal" code, a second color for highlighted code.

Syntax-colored code with yellow highlighting.

Syntax-colored code with bold highlighting.

It's hard to form an opinion without more than the tiny code fragments I've used in this blog post, of course, so please take a look at my draft Item for "Declare overriding functions override." It's available in two versions:

I realize that's not all possible combinations of choices, but putting together the various combinations is more work than you might imagine. That's why I've provided links to other examples where I've used different combinations of choices.
Please let me know what you think about the formatting choices I've described. Of course, I welcome comments on the technical content, too :-)

Monday, February 11, 2013

I've just updated my Upcoming Talks page with the public presentations that are currently scheduled for 2013. Most of them will take place in Europe (Oslo and London in June, and Stuttgart in November), but there are additional U.S. events in the works, so my talks at C++ and Beyond in December are unlikely to remain my only public presentations in the USA.

Of particular note is that I'll be giving presentations of my all-new-and-still-under-development seminar, Effective C++11 Programming, in Oslo, London, and Stuttgart, and there's a good chance that at least some of my talks at C++ and Beyond will focus on the effective use of features found only in C++11. In view of the fact that my big project for this year is writing Effective C++11 (see this post and this one for details), it should come as no surprise that that topic will be a leitmotif for 2013.

As always, details of my upcoming public presentations are to be found at my Upcoming Talks page.

The official announcement about dates and location for C++ and Beyond 2013 just went out on the C&B Blog. They're December 9-12 at the Salish Lodge in Snoqualmie, Washington, USA (not far from Seattle).

This fourth incarnation of C&B will harken back to its roots, in the sense that we're returning to our original venue, and we're also reinstituting some of the features of the initial C&B that had changed in the past couple of years.