Quantcast
Channel: Psychohistory
Viewing all articles
Browse latest Browse all 18

Source Code That Allegedly Broke the Microsoft Zune

$
0
0

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?


Posted in Developer, Microsoft

Viewing all articles
Browse latest Browse all 18

Latest Images

Trending Articles





Latest Images