Category Archives: Programming

How to stop Visual Studio 2010 showing the post-build Error List

One of my least favourite features of Visual Studio 2010 is that every time my build has an error, it pops up the Error List window. And every time, I switch to the Output window to read the full compiler error because the Error List doesn’t show enough information. In terms of interaction, that’s a major context switch – I’m focussed on the Output window looking at compile errors then BANG, the Error List interrupts my train of thought.

Now, I’ve tracked down this option to stop the Error List appearing:

20130503-184658.jpg

The remaining question is: why put this option under “Projects and Solutions” instead of under “Build and Run”?

Leave a comment

Filed under Programming

Algorithmic Interview questions (with solutions in F#)

InFSharpMajor.com is working through a book of algorithmic interview questions and solving them in F#. The questions come from this book which provides solutions in C++.

I think the problems and solution algorithms are interesting in their own right. I found the F# solutions a bit opaque (and I’ve been writing F# for several years), but my colleagues from a functional (*cough* Haskell) background tell me the idioms are well recognised in the community.

1 Comment

Filed under Programming, Soft skills

Idiot’s Guide to C++ Templates

This article on C++ templates is well written, if rather long!

The second part is here.

Leave a comment

Filed under C++, Programming

C++14: Runtime-sized arrays

More details on the ISO C++ blog about runtime-sized arrays in C++14.

N3639 proposes to add local runtime-sized arrays with automatic storage duration to C++, for example:

void f(std::size_t n)
{
int a[n];
for (std::size_t i = 0; i < n; ++i)
{
a[i] = 2*i;
}
std::sort(a, a+n);
}

Traditionally, the array bound “n” had to be a constant expression.

2 Comments

Filed under C++, Programming

ISO C++ Spring 2013 Report

Herb Sutter has posted his trip report from the ISO C++ Spring 2013 meeting in Bristol.

The post includes details on features to be included in C++14, including:

  • std::make_unique – never use “new” again
  • Generic lambdas – allow auto for type name in lambdas
  • Dynamic arrays – stack-based arrays can take size parameter at runtime
  • std::optional – for variables that are ‘not set’ (like F# option)
  • Concepts lite – constraints for templates

Leave a comment

Filed under C++, Programming

The Mythical Man-Month

The Guardian cites The Mythical Man-Month as mandatory reading for anyone planning a big software project. I’d agree, as well as recommending Peopleware (Tom DeMarco & Tim Lister) and Slack (Tom DeMarco)

1 Comment

Filed under Programming

F# Software Foundation

The F# community has founded a new organisation to promote the use of F# – FSSF

The mission of the F# Software Foundation is to promote, protect, and advance the F# programming language, and to support and facilitate the growth of a diverse and international community of F# programmers.

1 Comment

Filed under Programming

Herb Sutter – complex initialisation for a const variable

Herb Sutter provided this handy use of lambdas to initialise a const variable that needs some logic:

const int i = [&]{

    int i = some_default_value;

    if(someConditionIstrue)
    {
        Do some operations and calculate the value of i;
        i = some calculated value;
    }

    return i;

} (); // note: () invokes the lambda!

It requires that the compiler can determine the type of the lambda even though it isn’t a simple return – that’s due to be finalised in C++14 but is supported in some compilers already.

Leave a comment

Filed under C++, C++ Code, Programming

How to survive a ground-up re-write

Great war stories from a guy who’s seen a number of re-writes.

<Fortunately, there's a very simple test to determine if you're falling prey to the False Incrementalism: if after each increment, an Important Person were to ask your team to drop the project right at that moment, would the business have seen some value? That is the gold standard.

Leave a comment

Filed under Programming

Scott Meyers – Draft TOC for concurrency topics

Scott Meters has posted tentative item titles for the concurrency section in his upcoming Effective C++11 book.

Leave a comment

Filed under C++, Programming