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!

Security for virtualized datacentres

More from The Register

next story
Microsoft WINDOWS 10: Seven ATE Nine. Or Eight did really
Windows NEIN skipped, tech preview due out on Wednesday
Business is back, baby! Hasta la VISTA, Win 8... Oh, yeah, Windows 9
Forget touchscreen millennials, Microsoft goes for mouse crowd
Apple: SO sorry for the iOS 8.0.1 UPDATE BUNGLE HORROR
Apple kills 'upgrade'. Hey, Microsoft. You sure you want to be like these guys?
ARM gives Internet of Things a piece of its mind – the Cortex-M7
32-bit core packs some DSP for VIP IoT CPU LOL
Microsoft on the Threshold of a new name for Windows next week
Rebranded OS reportedly set to be flung open by Redmond
Lotus Notes inventor Ozzie invents app to talk to people on your phone
Imagine that. Startup floats with voice collab app for Win iPhone
'Google is NOT the gatekeeper to the web, as some claim'
Plus: 'Pretty sure iOS 8.0.2 will just turn the iPhone into a fax machine'
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.
Storage capacity and performance optimization at Mizuno USA
Mizuno USA turn to Tegile storage technology to solve both their SAN and backup issues.
The next step in data security
With recent increased privacy concerns and computers becoming more powerful, the chance of hackers being able to crack smaller-sized RSA keys increases.
Security for virtualized datacentres
Legacy security solutions are inefficient due to the architectural differences between physical and virtual environments.
A strategic approach to identity relationship management
ForgeRock commissioned Forrester to evaluate companies’ IAM practices and requirements when it comes to customer-facing scenarios versus employee-facing ones.