[phobos] datetime review

Jonathan M Davis jmdavisProg at gmx.com
Mon Oct 11 10:19:51 PDT 2010


On Sunday, October 10, 2010 09:20:31 Michel Fortin wrote:
> Le 2010-10-10 à 11:16, Jonathan M Davis a écrit :
> > Part of me would definitely like to keep MonthDuration, HNSecDuration,
> > and JointDuration as is, but the more I think about it, the more it
> > looks like it wouldn't be all that bad to have to work around their
> > lack, and while using the durations as they are really isn't all that
> > hard, it's going to confuse a fair number of people when they first
> > encounter them. So, I'm beginning to lean towards just simplifying it to
> > HNSecDuration (though I'd rename it as Duration in that case). It's
> > annoying in some cases, but it'll definitely cut down on the learning
> > curve for using the library.
> 
> Another option I might propose is to get rid of MonthDuration by using
> JointDuration instead and rename it to CalendarDuration.
> 
> But in my opinion, calendar things like this should simply belong to a
> separate module. This would simplify the API for those who don't need to
> deal with the complexities of the calendar.

That's not an entirely bad idea, but since any types which deal with durations 
would have to know about CalendarDuration, it wouldn't really help much. And 
while I completely agree that we want to make the more advanced features not get 
in the average users way, most of the calendar stuff is built into the types 
themselves, so you can't really create a calendar module to hold it. Fancier 
features like date recurrence patterns (which are heavily used by calendar 
applications) could be put in a separate module, but they can use the types in 
datetime rather than needing to be built into them (though they aren't 
implemented at present regardless). Durations a bit too integral for that.

- Jonathan M Davis


More information about the phobos mailing list