Re: [threeten-develop] What does this code do?
Status: Alpha
Brought to you by:
scolebourne
From: Stephen C. <sco...@jo...> - 2012-10-05 14:05:34
|
On 5 October 2012 06:49, Roger Riggs <Rog...@or...> wrote: > > If you have to deal with multiple calendar systems you are indeed > going to have to know what you are doing, such as not comparing the > year without first checking the calendar system and also checking the > era. > > The API should provide abstractions that do the comparison correctly and > make it easier to get it right than do write the code yourself. > For example, isBefore should be defined to correctly compare any dates. > A minimal API always forces the developer to fall back to their possibly > incorrect assumptions. isBefore only has one sensible definition - is date1 before date2 looking at epoh-days from 1970-ISO (or any equivalent time-line definition). That definition means that the year in two different calendar systems can clearly be in the opposite order to the before method. You are correct that a minimal API provides less support. But it should also be used by a far smaller fraction of developers. We must design for the many, not the few. Stephen. |