Arbitrary abbreviations in phobos considered ridiculous

Jonathan M Davis jmdavisProg at gmx.com
Tue Mar 6 15:48:32 PST 2012


On Tuesday, March 06, 2012 19:00:21 Andrej Mitrovic wrote:
> On 3/6/12, Dmitry Olshansky <dmitry.olsh at gmail.com> wrote:
> > It's coming from separate stopwatch module that got merged with
> > std.datetime, so the blame is somewhat misplaced :)
> 
> I've argued about it with the current DateTime Czar, so it's not
> really missplaced. :)

Units which are sub-second are abbreviated. The others aren't. Making it
secs would be more consistent with the sub-second names, but it would make
it less consistent with the others. The only thing which would be completely
consistent would be to abbreviate them all or to abbreviate none of them.
Abbreviations get very ugly (and harder to remember IMO) with the larger
units, and not abbreviating the smaller ones makes them ludicrously long.
So, the compromise is to abbreviate the sub-second units and not the others.
And I believe that std.datetime and core.time are very consistent with
regards to how units are abbreviated.

Now, as for  TickDuration in specific, there's a good chance that it was the
way that it is when it was created - in which case choosing seconds over secs
for that wasn't me - but it's consistent with all of the rest of the time stuff
regardless.

- Jonathan M Davis


More information about the Digitalmars-d mailing list