Feeds

Exceptional C++ and More Exceptional C++

Two essential aids for the C++ Interviewee

Internet Security Threat Report 2014

Book review This pair of books brings together a variety of small but annoying puzzles mediated by Herb Sutter through the news:comp.lang.c++.moderated newsgroup.

However, any irritation is in a good cause. Each puzzle illustrates an important point in C++ that many of us still get wrong. An early example is exception safe programming, which most of us (OK, yes, me), have struggled against. Fortunately for my self esteem, these puzzles are given a difficulty score of between 7 and 9 out of 10.

This gives a clue as to what these books really are, they’re not just textbooks. Instead, they map out 100 or so interview questions. Hence their awkward nature; the questions are supposed to be tricky. As a pimp who used to be a C++ contractor, I can say with some confidence that if you can get through these books, you will pass more than 80% of C++ interviews. However, these are not “…For Dummies” books, you are required to think hard and there is no real common theme beyond that of shattering any wishful thinking about your being a C++ guru.

Sutter is a Microsoft lackey, but fortunately, these aren’t Visual C++ books. Even though VC++ is vastly more standards conformant than it used to be, it is rarely mentioned except in connection with issues where the compiler gets to make choices.

Although inheritance is a common playground for interviewers, the coverage is sparse, probably reflecting Sutter’s accurate belief that as an O-O technique it is over used and, rightly, in relative decline as a programming technique.

Large scale design issues are skipped over lightly and, in general, these are books about programming in the small rather than the large. The exception to this is some waffle about header files in big projects and how to make them faster, which is rarely a critical issue in these days of precompilation and fast processors.

The second book emphasises STL and templates rather more and brings in threads. This is an area you really do need to start thinking about. Multi-core architectures mean that bog standard single thread code will execute 50%, or even 75%, more slowly than multi-threaded code on the same hardware; and that ratio is increasing. This is part of the optimisation theme, and although many books talk of writing “good” code, the hardcore stuff of making your code faster is usually rather skipped over in other books. Later in the book, Sutter points out some of the horrors that await the unwary over-optimiser [that’s good – Ed].

There is yet more on exception safety, which is clearly important enough for Sutter to bring his notion of programming “morality” to the topic. More Exceptional C++ also gives rather good coverage of the ancient dark art of pre-processor macros, a topic skipped over lightly in most other books. The sparse style is great for focusing on each issue, and for such short books, there's an impressive amount that you'll learn from them, although this comes at a price: if you don’t understand the example, you simply have to stare at it until it makes sense, because there is only ever one. You can of course argue that this is a good thing.

Exceptional C++ and More Exceptional C++

Verdict: If you’re going to go to a C++ interview any time in the next year, read these books and halve your chance of failure.

Author: Herb Sutter

Publisher: Addison Wesley

ISBNs: Exceptional C++ 0201615622; More Exceptional C++ 020170434

Media: Book

Buy Exceptional C++ at Cash & Carrion!

Buy More Exceptional C++ at Cash & Carrion too!

Choosing a cloud hosting partner with confidence

More from The Register

next story
Netscape Navigator - the browser that started it all - turns 20
It was 20 years ago today, Marc Andreeesen taught the band to play
Sway: Microsoft's new Office app doesn't have an Undo function
Content aggregation, meet the workplace ... oh
Sign off my IT project or I’ll PHONE your MUM
Honestly, it’s a piece of piss
Return of the Jedi – Apache reclaims web server crown
.london, .hamburg and .公司 - that's .com in Chinese - storm the web server charts
NetWare sales revive in China thanks to that man Snowden
If it ain't Microsoft, it's in fashion behind the Great Firewall
Chrome 38's new HTML tag support makes fatties FIT and SKINNIER
First browser to protect networks' bandwith using official spec
Admins! Never mind POODLE, there're NEW OpenSSL bugs to splat
Four new patches for open-source crypto libraries
prev story

Whitepapers

Forging a new future with identity relationship management
Learn about ForgeRock's next generation IRM platform and how it is designed to empower CEOS's and enterprises to engage with consumers.
Why cloud backup?
Combining the latest advancements in disk-based backup with secure, integrated, cloud technologies offer organizations fast and assured recovery of their critical enterprise data.
Win a year’s supply of chocolate
There is no techie angle to this competition so we're not going to pretend there is, but everyone loves chocolate so who cares.
High Performance for All
While HPC is not new, it has traditionally been seen as a specialist area – is it now geared up to meet more mainstream requirements?
Intelligent flash storage arrays
Tegile Intelligent Storage Arrays with IntelliFlash helps IT boost storage utilization and effciency while delivering unmatched storage savings and performance.