std.datetime is too big

Somedude lovelydear at mailmetrash.com
Sat Nov 5 00:58:27 PDT 2011


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 ?


More information about the Digitalmars-d mailing list