[phobos] datetime review

Walter Bright walter at digitalmars.com
Fri Oct 8 22:00:50 PDT 2010



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.

> Also, as much as there is, a large portion of it is unit tests and 
> documentation. There's definitely more unit tests than normal code, and there 
> might be more documentation than normal code.
>
> One point that may need to be improved is the module documentation so that it's 
> more obvious exactly what you need to just get the time and print it out or 
> whatever the insanely simple operations are that would be typical in your 
> average program that does little with the time. I am afraid that it is a bit 
> like std.algorithm in that it's quite easy to use but a bit overwhelming to look 
> at so that you _think_ that it's hard to use, even though it really isn't. I do 
> have quite a few examples it the code though, and I hope that the documentation 
> is generally clear enough. I tried to make it so that it was, but it really 
> needs to have people who aren't familiar with it judge it at this point.
>
> - Jonathan M Davis
> _______________________________________________
> phobos mailing list
> phobos at puremagic.com
> http://lists.puremagic.com/mailman/listinfo/phobos
>
>
>   


More information about the phobos mailing list