tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: strftime(3) oddities with %s, %z



> When %s was added to strftime() it was done by simply calling
> mktime().  I don't know who originally did that, but that's what
> happened, and after that the interface was simply copied.  [...]

> [...redesign...]
> But doing that in a way that's agreeable to everyone, and then
> getting it actually used by applications, is a huge job.   It will
> take years (writing the struct definition, probably just days, or
> weeks for agreement, writing (or modifying) all the library code
> certainly weeks, probably longer to get better interfaces than we now
> have, updating all the applications years, or even decades.

Decades to get it in use, certainly.

But I see no need to bother with agreement.  Whoever added %s didn't
canvas the community and get agreement; they just added the code.
Whoever added long long to C didn't plan (as far as I can tell); they
just added it, it got popular and became an ascended glitch.

I suspect that's what will happen here.  If - when, I hope! - we get a
better interface, I suspect it will not be a result of a bunch of
planning and coordination; it will be someone getting fed up and
implementing _something_, and it's "good enough" so it gets popular and
becomes a de-facto standard, eventually becoming a de-jure standard.

I just hope whichever one ends up getting popular turns out to have
been done by someone relatively sane.

On other fragments of this mail,

> The standard is going to (as it should) say what works now,

I'm not sure I agree that it should.  Sometimes "what works now" is
broken enough, or inconsistent enough, that standards do invent new
things.  Occasionally, even, we get good standards that way.

> [...redesign...].   Aside from anything else tm_year being an int is
> just too small, [...]

...??  You're concerned about the interface design lasting past
Gregorian 34737 (or 2147485617, if you abandon <32-bit ints)?

/~\ The ASCII				  Mouse
\ / Ribbon Campaign
 X  Against HTML		mouse%rodents-montreal.org@localhost
/ \ Email!	     7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B


Home | Main Index | Thread Index | Old Index