[phobos] next release (module useability)

Jonathan M Davis jmdavisprog at gmail.com
Fri Sep 10 23:10:26 PDT 2010


On Friday 10 September 2010 22:40:58 SHOO wrote:
> My question is simpler.
> 
> I want to know the reason.
> 
> time is a concept including date.
> stopwatch/benchmark is a part of time, but it is not a part of date.
> date is redundant if so.
> Nonetheless what will the reason to add date to a module name be?

Date functionality and time functionality are not necessarily the same in 
nature. You do different sorts when you're dealing with dates then when you're 
dealing with time. However, they do overlap a fair bit, so it can get a bit 
complicated and subjective.

If you had std.date and std.time, then it would make sense for date-specific stuff 
to go in std.date and time-specific stuff to go in std.time. By having 
std.datetime, you're indicating that both the date-specific stuff and the time-
specific stuff are together. A module named std.time doesn't necessarily have 
anything to do with date functionality, while std.datetime clearly has both (on 
the other hand std.date is arguably a bad name all around because while dates 
are times, times aren't necessarily dates).

Now, dates _are_ time-related even if dates and times and their associated 
functionality are often dealt with quite differently, so it does make some sense 
to simply name the module std.time. However, it's not as immediately obvious 
that the module covers both date and time functionality. So, I think that 
std.datetime is a better name, but std.time would certainly work.

> /* The reason of this question is because there was the doubt why naming
> it is WAG for of the module of Phobos before in Japanese community. (The
> subject at that time was "Why are std.file and std.path separated?") */

Files and paths are related but are very different issues, so it doesn't surprise 
me at all that they're separate. On the other hand, it's not like it wouldn't 
make sense to have them together either, since they are very much related. But 
personally, I think that it makes more sense to have them separate.

- Jonathan M Davis


More information about the phobos mailing list