News for hackers. Stuff that matters.
Re:Ruby 1.9 doesn't implement ISO 8601 properly by secure on Sunday February 24, 2013 @10:30AM (#5274509)
I think it would make the point much clearer if the author of that article would actually explain a use case for this (apparently incorrectly handled) syntax which I have never ever come in contact with :).
Re:Ruby 1.9 doesn't implement ISO 8601 properly by wereHamster on Sunday February 24, 2013 @10:42AM (#5274557)
1) It's in the standard. If you call a function iso8601 you better follow that standard. Or document where the function deviates from it.

2) Just because you didn't come in contact with ordinal dates doesn't mean others don't need it.

3) The article has a link to https://en.wikipedia.org/wiki/Ordinal_date. The wiki page doesn't have any specific use cases but just use your imagination.

Re:Ruby 1.9 doesn't implement ISO 8601 properly by dfox on Sunday February 24, 2013 @10:40AM (#5274554)
Usecase is that there are various embedded/industrial/enterprise systems that return and expect dates in either of those two formats as part of their API. Either because they want to represent the idea of "month" or because they don't care about days and not about week days and months (Implementing whole calendar in random embedded/industrial system is unnecessary busywork that costs you not only effort but also code size)
Re:Ruby 1.9 doesn't implement ISO 8601 properly by bvdbijl on Sunday February 24, 2013 @10:37AM (#5274540)
Well the point is that they shouldn't call the method iso8601 if it doesn't implement the whole iso8601 standard
Re:Ruby 1.9 doesn't implement ISO 8601 properly by viraptor on Sunday February 24, 2013 @10:56AM (#5274607)
That's a bold statement. I don't think I've ever seen a program / library which implements any standard completely and without issues. It's not uncommon to see a list of things that are not done, incomplete, or just called out as wrong and rejected from the implementation.

It's not perfect, but no implementation will ever be imho.

Re:Ruby 1.9 doesn't implement ISO 8601 properly by harshreality on Sunday February 24, 2013 @02:24PM (#5275506)
Not implementing part of a standard is different from implementing it differently than the standard specifies.

YYYY-MM is year-month, not year-day365. It's not very reasonable to interpret yyyy-mm as year-day365 in a function called iso8601 when the standard says that's not how to interpret it.

Re:Ruby 1.9 doesn't implement ISO 8601 properly by jeffdavis on Sunday February 24, 2013 @12:17PM (#5274950)
I think it's OK to be missing a few aspects of the standard. But in that case, it should still parse correctly and throw a "not supported" exception for unsupported features.

Parsing it incorrectly is bad news.

Re:Ruby 1.9 doesn't implement ISO 8601 properly by evilduck on Sunday February 24, 2013 @12:01PM (#5274887)
Ever seen a method called "validateEmailAddress" or something similar? Take any given implementation of that and you can predict with almost certainty that it does not validate all possible valid email addresses (which also has a spec that even came along after the internet was conceived).