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?
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