NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.
All the Perl that's Practical to Extract and Report
Stories, comments, journals, and other submissions on use Perl; are Copyright 1998-2006, their respective owners.
What amazes me the most... (Score:1)
... is despite all the vast amounts of code in the Microsoft mobile areas, there wasn't something reusable for that, because clearly someone's had to write it from scratch some time in the last 4 years.
Re: (Score:1)
Maybe it's so vast noone can find things in it.
Or maybe it's there, but coupled to other things they can't afford to bring in along with the deps.
Re: (Score:1)
It was not a Microsoft bug [newsvine.com]. Which goes to show the dangers of reusing someone else's code.
Not a strong typing kind of bug (Score:2)
First, I appreciate the schadenfreude here as much as the next hacker, but it appears this bug was in the Freescale code for the platform, not the code Microsoft wrote for the Zune. So it effects more than just Zunes...
Second, the "some type inference systems" is misleading. The one type inference system that Andrew Koenig and MJD discuss is the Hindley-Milner [wikipedia.org] type system, which is used in ML and its descendants (OCaml, F#, Haskell, etc.). Koenig's example demonstrated that a recursive algorithm would
Re: (Score:2)
Thanks for the extra information.
I think, ultimately, that part of the problem here could be alleviated by coupling things which must be coupled. For example, having a DayOfYear type with a type coercion system could partially help. Imagine the following type definition (in Perl 6, which doesn't do inferencing, of course, but bear with me):
Obviously, that still leaves edge cases, but I would imagine with inferencing, while you wouldn't get a compile
Re: (Score:2)
All of this, of course, if from a typing newbie, so if I'm talking complete bollocks, feel free to correct me!
You're talking complete bollocks. :-)
The kinds of things a strong static typing system can do is let you create types like DayOfYear, which let you specify a single calendar date, and prevents such nonsense like the 47th of April as being a "date". From there, you can create functions like addDays that take a DayOfYear and an integer number of days and return a new DayOfYear.
What this code was doing was taking a count of days since the beginning of time, and figuring out the current date by subtractin
Re: (Score:1)
I think the mindblowingly clever technology you are looking for here is called a truth table. :-)