[phobos] datetime review

Jonathan M Davis jmdavisProg at gmx.com
Fri Oct 8 22:29:58 PDT 2010


On Friday 08 October 2010 22:00:50 Walter Bright wrote:
> Jonathan M Davis wrote:
> > I should probably add that the seven modules aren't exactly equal in
> > size. In particular datetime.all only has its module documentation and
> > public imports for all of the other modules, and datetime.other is quite
> > small. I didn't necessarily split the code into modules in the best
> > manner. I split it more on concepts than the amount of code in them (so
> > datetime.timepoint probably has close to half of the code in it). I'm
> > open to suggestions if someone has a better way to split the code up.
> > Ideally, it would all be in one module, but it was too much for one.
> 
> I agree that modules should be organized by concept rather than size.
> But also, I don't know of a rule that says a module is "too large",
> unless that module contains concepts that are independent of each other
> and that users will rarely require both at the same time.
> 
> Remember, if a module's implementation code is large, it can be split
> into a .di/implementation pair, rather than into multiple modules.

That I was not aware of. I'm certainly open to doing that instead. It's just 
that the file was around 40,000 lines, which was getting to be a bit much to deal 
with in one file (I don't believe that any of the current Phobos modules even hit 
10,000). Splitting the interface out like that would move the documentation out 
of the source file (for better or worse), which would definitely cut down on its 
size, though it's the unit tests that take up the most space.

Really, the ideal would be to have all of it in one module but have the code 
split up into several files. The closest way that I was aware to do that was to 
use a single module which publicly imported the others. I'll look at splitting 
it into an interface file and source file though.

- Jonathan M Davis


More information about the phobos mailing list