Source Code That Allegedly Broke the Microsoft Zune

Thanks to Lawrence, Ryan, JSTN.

while (days > 365) {
    if (IsLeapYear(year)) {
        if (days > 366) {
            days -= 366;
            year += 1;
        }
    } else {
        days -= 365;
        year += 1;
    }
}

For non-programmers out there, this is what we like to call in technical terms “an infinite loop”. This code block will never finish running because on Day 366, the loop keeps checking to see if the day is greater than 365 (it is), and then checks to see if it’s a Leap Year (it is), and then checks to see if it is greater than 366 (it isn’t). So it does nothing, and then starts all over.

Perfect way to lock up your Zune every four years on the last day of the leap year.

Not sure if this is the actual code snippet or not, but a fun exercise. I could actually see this being on an introduction to programming test at some point.

My favorite quote about this fiasco (from the San Jose Mercury News):

“I’ve never heard of a consumer electronic device fail en masse like this,” said Matt Rosoff, an analyst with Directions on Microsoft, a Seattle-based research firm that focuses on the software giant.

Does anyone doubt that “Microsoft Zune” has become the “Ford Pinto” of consumer electronics?

2 thoughts on “Source Code That Allegedly Broke the Microsoft Zune

  1. Well, to be honest, yes, I doubt it. The error (a) was self-correcting, (b) affected a small subset of Zune devices – even a subset of Zune 30GB devices, and (c) was trivial in impact.

    So, I’ll keep enjoying my 120GB. I have owned (and still use) iPods as well, but like the Zune better actually.

    One might think I’m biased as I work for Microsoft, but I held out on buying a Zune for a year until its positive reviews simply convinced me, and now I’ve discovered they’re right 🙂

    • I suspect that your bias doesn’t come from working for Microsoft per se, but that by working for Microsoft you are actually surrounded by one of the very few peer groups in the world where anyone would talk to you about the Zune at all. 🙂

      Of course, since I owned and used an Apple Newton MessagePad 2000 for over a year (and was quite happy with it), I guess I can understand your Zune.

      Of course, my guess is 10 years from now, you’ll have this fun anecdote to tell about the years you worked at Microsoft and actually owned a Zune.

      Good tech trivia for 2020.
      Adam

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s