Skip to content

Remove the concept of missing vs zero values from Period. #90

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
GoogleCodeExporter opened this issue Mar 15, 2015 · 6 comments
Closed
Labels
Milestone

Comments

@GoogleCodeExporter
Copy link

Period differentiates between "10 years" and "10 years, zero months"; the 
latter contains the Months PeriodUnit; the former does not.

However, both instances will compare as equal, and in both cases Months will 
return zero; the only differentiation is via the Units property.

Do we actually have a sensible reason to support differentiation between 
zero-valued and absent-valued properties?  If not, we could consider simplify 
Period somewhat by removing the Units property entirely, making PeriodUnits 
simply an input parameter to Between methods (and internally, as an 
implementation detail in Period).

[In particular, the fact that equal Periods can have different Units property 
values is troubling me; if they're not intended to be interchangable, why are 
they equal?]

Original issue reported on code.google.com by malcolm.rowe on 26 Jul 2012 at 1:40

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants