The publisher would like you to believe that this thriller series centred on Mitch Rapp is on a par with Lee Child’s Jack Reacher. I disagree – whilst there’s enough intrigue to keep you reading to the end, it’s not in the same league as a Jack Reacher book.
Book Review: Kill Shot, Vincent Flynn
Filed under Book Review
Book Review: The Burning Wire, Jeffery Deaver
This is another of Deaver’s Lincoln Rhyme thrillers. It features The Watchmaker, a killer from one of his previous books, who has turned up in Mexico. In fact, Deaver uses this side-plot to introduce his other character Kathryn Dance for some free publicity.
The main plot concerns a series of horrific incidents where the perpetrator connects a device to the main electricity lines to cause devastation. He’s not adverse to more direct action on individuals either – but Lincoln Rhyme is able to track him using uncanny forensics and insight.
I may have missed some of the suspense and intrigue because I hadn’t read the previous Watchmaker book – reading them out of order, I was a little underwhelmed.
Filed under Book Review
How to speed up your C++ build
I’ve been working on a software library for some time and have seen it grow to include a large number of types. This has gradually increased the time needed to build the library – in fact, to build the whole package in our CI system recently hit an hour. At that point, I needed to take action to bring the build time back to a reasonable level.
- Increase the number of cores on the build machine
- Reduce the number of header includes per source file
- Configure pre-compiled headers on the largest projects

The graph above shows the improvements with each step. Doubling the number of cores on the build machine halved the build time because much of the time is spent compiling .cpp files which can be done in parallel.
Reducing the number of header inclusions also had a big effect. Initially, I’d taken the approach that all headers could be included stand-alone, and they would include their own dependencies. For this large project, though, that turned out to be expensive – so instead, I produced a single header that included all the others in the right order. Although that also has drawbacks (like, any change to any of those headers forces all the project files to be re-built), it’s reasonable for the workflow involved in this area of work.
Finally, turning on pre-compiled headers had a really noticeable improvement – particularly in building individual projects within the package (which many of our developers will be doing). From what I’ve read on MSDN, the previous step was a pre-requisite – it’s recommended to have .cpp files include the same framework header files in the same order.
Filed under C++, Programming
C++: reasons to return void and/or return early
I was recently refactoring some code, leaving a function in which the most natural thing was to return a call to a void function. The code structure was like this simplified example, where I wanted to return early from a nested if statement, but it felt clumsy to put bar() and return on separate lines:
void bar()
{
printf( "bar\n" );
}
void foo( int a, double b )
{
if ( a > 0 )
{
double c = a * b;
if ( c > 0 && c > a )
{
return bar();
}
}
printf( "foo\n" );
}
I was surprised that this worked, because I half expected the compiler to do something sinister like optimise out the call to bar(), given that it returns void and only executes useful code via side-effects.
This post asks the same question, but it seems that this is supported in C++ and can be useful for template functions that return void.
Some readers may take issue with the early return in the code above. I admit I used to follow the mantra of maintaining a single return point in any function (except perhaps an early return after checking pre-conditions on parameters). However, the modern C++ take on this is that early returns are recommended and may lead to faster code. Herb Sutter has this to say:
allowing the function itself to return early when it knows it’s done is perfectly fine and fully under the function’s control. To put the final nail in the coffin, note that “single exit” has always been a fiction in any language that has exceptions, because you can get an early exceptional return from any point where you call something that could throw an exception
.
Filed under C++
Time to celebrate engineers
Brian Cox has done his bit to raise the profile of engineering.
“The impact of science and engineering is central to our culture,” said Prof Cox. “It is the most important thing we do in civilisation and what engineers do genuinely affects people’s lives.
“We need a cultural shift to celebrate intellectual adventuring: engineers and scientists should be celebrated more than X Factor stars are.”
The Institute of Engineering and Technology regularly bemoans the lack of a professional designation for engineers, equivalent to a doctor or chartered accountant. Anyone can claim to be an engineer, leading to a lack of status.
Filed under Uncategorized
Book Review: Personal, Lee Child
This is the latest Jack Reacher thriller – I bought it hot off the press in the autumn but kept it until Christmas. This story is for a large part set in London, which unusual for these thrillers. Reacher must engage rival gangs in the East and West End to track down a sniper who wishes revenge on Reacher himself. Reacher has to outwit Little Joey, who dwarfs Reacher (no mean feat, Reacher is 6’6″ and 250lbs, something Hollywood casting directors would do well to remember).
Ultimately this book is more A Wanted Man than Never Go Back, but worth a read nevertheless.
Filed under Book Review
Book Review: Foundation’s Triumph, David Brin
This is the third of the second foundation trilogy written by authors Benford, Bear and Brin. It tells the story of Hari Seldon’s ‘Last Hurrah’ as he undertakes a voyage away from Trantor in his old age. I really appreciated how this author brought the many threads of the stories together, including the motivation behind many of R. Daneel Olivaw’s plans. In fact, it’s the first time I’ve fully grasped the inter-robot battles and the reasons why many did not support Olivaw’s Zero’th law revolution.
Filed under Book Review
Book Review: Bravo Two Zero, Andy McNab
I read this book some time after reading The One that Got Away by Chris Ryan, another story from the Bravo Two Zero mission. That didn’t prepare me for either the foul language in McNab’s book or the horrific treatment he and the other soldiers received after capture by the enemy. The story is gripping and certainly no holds are barred in the telling.
Filed under Book Review
SatNav Innovation by Jaguar
Jaguar have proposed a new approach to navigation – displaying a ghost car to be followed along the route.
Officially known as “Follow-Me Ghost Car Navigation,” the system uses the heads-up-display technology to project an illuminated “ghost car” that looks to be driving right in front of the actual vehicle.
It’s a brilliant example of putting the information exactly where the user wants it.
Filed under Technology
How to change notepad print formats
It’s sometimes useful to use notepad to print basic text, but it also prints a header and footer by default.
It turns out that you can change the formatting, for example to output the current date and time.
Command Action
——- ————————————–&l Left-align the characters that follow
&c Center the characters that follow
&r Right-align the characters that follow
&d Print the current date
&t Print the current time
&f Print the name of the document
&p Print the page number
Often, though, you might want the print format to be disabled by default
Goto the key HKCU\Software\Microsoft\Notepad
Then add string values “szHeader” and “szTrailer” with value “”
.
Filed under Technology




