Religious conversion

jdavidb on 2008-11-26T15:50:15

In keeping with the maxim "Be strict in what you emit, and liberal in what you accept," isn't writing a method to convert an ISO standard YYYY-MM-DD date into MM/DD/YYYY format a violation of my religious principles?


missing context?

slanning on 2008-11-26T16:59:06

I don't understand why it would be, so I think I'm missing some things. If you're lenient in what you accept, you'd need a lot of conversions.

nope

rjbs on 2008-11-26T20:43:49

...because MM/DD/YYYY is a strictly-defined thing. It would be awful if you emitted "something that people can tell is a date or something."

You know. Like "anything that matches RFC 822 dates."

Re:nope

Ron Savage on 2008-11-26T23:09:42

MM/DD/YYYY is not strictly defined here in Australia, since we often don't know if it's just American racism, or if the date is actially DD/MM/YYYY.

Re:nope

Alias on 2008-11-26T23:54:18

Indeed.

The only time you should ever be using MM/DD/YYYY is if you are talking to some legacy system that only understands that format, or if you are making content for users that you can be sure are Amercians.

And god help you if you ever try to use it to serialize dates into a file format.

Re:nope

rjbs on 2008-11-27T00:03:40

Uh. No, you're being a bit odd.

MM/DD/YYYY is very very very well defined. It means two digit month, two digit day of month, four digit year.

NN/NN/NNNN is obviously extremely confusing because of what you said.

If you have defined, in your data format definition, that dates are MM/DD or DD/MM, it is perfectly unambiguous, because the context (of the specification) makes it clear.

If you are emitting something with no specification, then that's a different matter.

Re:nope

Aristotle on 2008-11-28T13:56:34

The point is that reasonable people do MM/DD/YYYY, and reasonable people do DD/MM/YYYY, and there is no way to tell whether NN/NN/NNNN is one or the other just by looking at it. So you need to refer to an external authority, and deity help you if you have none. In contrast, no reasonable person does YYYY-DD-MM, so if you get NNNN-NN-NN you know how to interpret it just by looking at it. In that sense, it is better to always use NNNN-NN-NN because the format is self-documenting.

Re:nope

rjbs on 2008-11-28T15:32:39

I understand why to use YMD format. I use it. I don't understand how that's relevant to writing a method that emits MDY to be a violation of one's ethics. It emits a known quantity.

Using it stupidly is completely unrelated.

Re:nope

Aristotle on 2008-11-28T19:05:11

Because it makes one party to the perpetuation of a bad design. (And egregious ambiguity in data such as the DMY/MDY confusion is the worst kind of bad design there is.) Now we don’t always have a choice in what to implement (f.ex. when implementing a standard that prescribes the dumb choice), but that doesn’t make the design any better. (You might say it is well specified, but considering the consequences of moronity and Ruby’s postulate in tandem, that means the specification, however rigorous, is still a bad design.) That’s all. Doesn’t mean refusing to do the job, but it does mean discomfort with the necessity.

Re:nope

jdavidb on 2008-12-02T20:11:43

In that sense, it is better to always use NNNN-NN-NN because the format is self-documenting.

I sadly have to differ with that. I use ISO standard YYYY-MM-DD dates all the time. I write dates this way every chance I get. And I'm constantly having to explain to people what it means.

The average person on my continent simply cannot figure out the standard, even though it is mind-numbingly obvious.

Sigh.