You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, Duration exposes a bunch of canned fields like Zero, OneMinute,
NegativeOneTick, and so on. It also exposes sensible operator overloads and
factory methods, meaning that it's unclear as to whether 'a duration of three
days' should be best constructed via:
Duration.FromStandardDays(3)
or
Duration.OneStandardDay * 3
I suggest that we pick one, and I'd tend toward the factory methods, rather
than trying to provide a bunch of fields for 'common but not really' durations.
Alternatively, we should remove the factory methods (apart from FromTimeSpan())
and rationalise the common durations (removing NegativeOneTick in favour of
-OneTick and adding OneStandardWeek). But I'd prefer the former, I think.
Original issue reported on code.google.com by malcolm.rowe on 20 Apr 2012 at 1:47
The text was updated successfully, but these errors were encountered:
Agreed, let's get rid of at least most of the constants. Zero makes sense, and
*potentially* OneTick as an equivalent of Epsilon to some extent. Maybe
MinValue and MaxValue? OneWeek etc should go.
Original comment by jonsk...@google.com on 23 Apr 2012 at 8:31
Fixed in revision 0cf928ea05d7.
We could also now decide to make e.g. FromStandardWeeks(1) return the
OneStandardWeek constant (etc), but that's an optimisation we can do later if
at all.
Original comment by malcolm.rowe on 23 Apr 2012 at 11:00
Original issue reported on code.google.com by
malcolm.rowe
on 20 Apr 2012 at 1:47The text was updated successfully, but these errors were encountered: