H
Harold Yarmouth
Lew said:Nope.
True, but they don't have disk files last modified in the time of
Christ, or network packets timestamped during the Fall of Rome.
"Harold Yarmouth"'s point was irrelevant
No, it was not.
as well as incorrect.
No, it was not.
The evidence was to show that calendars are not neat mathematical
constructs, which it did show.
That is what is irrelevant. My point is that for things like interfacing
with network packet timestamps, file modification dates, and the like,
under the hood, one emphatically does not need a non-Gregorian calendar.
In fact, this whole issue arose when I was coding a utility to check
file modification dates, compare them, and the like. For some stupid
reason File does not provide such in the form of a Date, only in a raw
seconds-since-the-epoch type form, conversion to Date of which requires
a bunch of annoying arithmetic. And then Calendar was going and
introducing an essentially-random component that caused a file to look
like it had an unequal file modification time to itself.
I do have to wonder why there isn't apparently a better way in the
standard library, such as a Date-returning method of File, in addition
to wondering why the hell you have to go through Calendar even in the
simple case where you don't care about localization, don't need to care,
and just want a java.util.Date representing a given time you got in some
other format. Calendar's appropriateness in the BLL is arguable (and
being argued as we speak). Calendar's appropriateness in the DAL,
however, is absolutely zero, and that's where I found myself needing to
use it to work with file modification dates in an object oriented way.
I've long since fixed it to ignore the spurious milliseconds values. In
fact I'd done so before I even started this thread.
Now, after all of this pointlessly-acrimonious arguing*, I'm tempted to
change it again to just treat the dates as raw longs and the hell with
object orientation, just to wash my hands of Calendar entirely.
* And why is it so acrimonious? I made a simple and civil post reporting
undesirable and possibly-buggy behavior of a library routine. Then
people jumped down my throat. Apparently it's not enough to simply
disagree with someone around here -- if you disagree with someone you
have to insult them and call them names in public, and generally pick
a fight with them! Why??? What kind of stupid rule compels such
ridiculous and childish behavior? Hell, hardly anybody really DOES
disagree -- six or seven people agreed that the behavior in question
was undesirable, and although there's been debate as to whether it
technically constitutes a bug, I'd said POSSIBLY buggy, not DEFINITELY
buggy. The subject line, in particular, says so.
And why do some people keep bringing up Twisted and your dispute(s)
with Twisted? None of that seems remotely relevant to the
Date/Calendar thing. As I understand it, the argument you had with
him was about which editor was better, vi or emacs. That has nothing
at all to do with Date/Calendar/business layers/anything else in your
dispute with me!
It is relevant that not every day is 24 hours long, so naive
calculations based on that assumption will give incorrect results from
time to time.
I wasn't proposing to make naive calculations. You have misunderstood me
severely.