std.datetime is too big

Jacob Carlborg doob at me.com
Sun Nov 6 23:17:02 PST 2011


On 2011-11-05 08:58, Somedude wrote:
> Hello,
>
> I've been lurking for a while here and I really appreciate all the work
> that is done on D and Phobos. This is a fantastic language and a great
> little community. So I don't want the following comments to be badly
> perceived and I hope they will be seen as constructive.
>
> Browsing through the source code of Phobos, I "stumbled" upon the huge
> block that is std.datetime. Now I know that know that date/time is a
> very complex subject, and that this module has been written by Jonathan
> Davis, who is one of the smartest guys out there, so I am certainly not
> going to comment on the implementation.
>
> However, I believe the interface is way too big at the moment, and would
> highly benefit from being broken up into more focused modules. Just
> looking at the std.datetime Ddoc is a pain, let alone understanding how
> to do fairly simple tasks.
>
> For me, the module contains way too many disparate concepts to be usable
> at the moment:
> - time zones
> - calendars
> - time intervals and ranges over intervals
> - formatting and validation
> - stopwatch
> - benchmark
>
> It looks that everything time related has been crammed in this single
> module. It makes it unnecessarily hard to understand what to choose and
> how to use it. Also,>34,000 LOC makes the code nearly impossible to
> review and help/correct for people who are not the authors.
>
> I would suggest breaking this module into submodules per concept or
> activity, maybe something like:
> std.datetime.timezone
> std.datetime.calendar
> std.datetime.interval
> std.datetime.format
> and I would entirely remove everything related to stopwatch and
> benchmarking for another module.
>
> What do you think ?

Yes, please make a package of this module and split the module into 
several smaller modules, it IS too big.

-- 
/Jacob Carlborg


More information about the Digitalmars-d mailing list