On Wed, 1 Oct 2008, Zefram wrote:

So, anyway, most users don't need precise leap second handling.  Many,
presumably, do need (approximate) calculations on times in the future
and before 1972.  It is sensible for them that vague-regular-UT is
used in those eras.  But they'd be better served by a *consistent*
vague-regular-UT model.  No one is well served by the mixed model: it's
vague *ir*regular UT, not guaranteeing any of the useful things that
its component models do.  DateTime tries to be everything to everyone,
and suffers from the resulting contradictions.

It's all tradeoff.

The more variations of correctness DateTime offers, the more the end user of the module has to understand in order to make the module do something. In other words, more options means a bigger API which means more docs, more examples, more stuff to learn about before you can get started.

It's already bad enough with having to decide how to do date math. Specifically, to really do date math in an informed way, you first need to decide on what time zone to do it in (floating, UTC, or local). If you're using anything but floating, you then need to think about what order the math is done in (second then days, or the reverse?).

In the case of UTC and leap seconds, most people probably don't care or _need_ to care, so DateTime works just fine. For those folks who need to care, they probably know what to look for, and can use Time::UTC.

This is different from date math, where most folks know enough to expect _some_ answer but not enough to know the nuances. They try to use DateTime, maybe get a confusing answer (depending on their expectations), and can then read the docs explaining all the painful things they need to think about.

If I had it to do all over again, I might consider just ignoring leap seconds altogether. It'd certainly make the internals much simpler. Then for people who actually care, there would be a separate module that handled leap seconds (and maybe _not_ time zones).

I guess we'll see what happens for Perl 6.


-dave

/*==========================
VegGuide.Org
Your guide to all that's veg
==========================*/

Reply via email to