Skip to content

When version checks go wrong

by Brandon on October 29th, 2009

Ars Technica’s review of Windows 7 is extensively detailed and contains a lot of good information.  But one piece jumped out at me, and that was this paragraph on the last page:

If Vista had gotten the reception it actually deserved, and become a brand worth keeping, it seems highly likely that the name would have been retained. And Microsoft knows it, which is why internally, Windows 7 is only version 6.1. Sure, the company has made specious claims that this is to avoid breaking applications with bad version checks, but the logic doesn’t really hold; many of those applications are just as broken by “6” as they would be by “7,” and if that were such a concern then the minor version wouldn’t change either.

This might make sense to a lay person on a cursory reading, but as usual with software development, reality is full of subtle but important complexities. 

Pop quiz

Consider the following rather common version checking mistake:

// Our app is designed for XP (5.1) and later
if (majorVersion >= 5 && minorVersion >= 1)
{
    // Succeed
}
else
{
    // Fail
}

Given the returned version values from Windows XP (reports 5.1), Windows Vista (reports 6.0), and Windows 7 (reports 6.1) – which OSes will this program succeed on?

From → Technology

3 Comments
  1. anonymous permalink

    But does this really mean that a major full release with serious overhaul of under-the-hood technlogies will only see the version increment to 6.2 or 6.x?

  2. What it means is that bumping the minor version this time around made sense.

    I’m most specifically refuting the last sentence of the Ars paragraph, notably “and if that were such a concern then the minor version wouldn’t change either.”

  3. Dan permalink

    This is one of the reasons why we have Compatibility mode, though! 🙂 Makes the app think the Windows version number is different.

Leave a Reply

Note: XHTML is allowed. Your email address will never be published.

Subscribe to this comment feed via RSS