-
Notifications
You must be signed in to change notification settings - Fork 152
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
Concerns about options parameter in LocalDateTime.prototype.compare
#719
Comments
Good question. A goal of So I don't think it'd be a good tradeoff to remove this method, because it wouldn't make the unusual use case any easier but would make the vast-majority use case much harder in every dimension: more typing, more concepts to learn, and more decisions needed. Instead, if we're concerned about complexity of this option, I'd suggest removing the option and just always use ldtArray.sort((ldt1, ldt2) => Temporal.DateTime.compare(ldt1.toDateTime(), ldt2.toDateTime()); This ergonomics is IMHO worse than a usually-defaulted option, but it's a rare use case so i don't feel strongly either way, as long as we keep the nice ergonomics of the main use case which is: ldtArray.sort(Temporal.LocalDateTime.compare); BTW, the original design for this method was |
@ptomato replied in #700 (comment):
|
In my experience this depends on the developer. Novice developers typically use options only if their initial attempt at using defaults doesn't return valid-looking results. Adding options doesn't add much difficulty for them because they usually ignore options whenever possible. For advanced developers, I'm inclined to agree with you-- a new option to learn is probably harder than being referred by docs to an existing known type, especially for obscure cases like The bigger cognitive load I'm worried about here is the decision point. If we don't have
Yep, this question has been raised by @sffc and @pipobscure too, so it'd be helpful to come up with a consensus answer. Could we follow up on this topic in #706 and keep this issue focused on |
Another argument for having |
With the decision philosophy of "LocalDateTime is an event that happened, or will happen, in a particular place" - it seems to me that LocalDateTime should have Absolute compare semantics. |
Yep, agreed. I'm going to close this issue as resolved by removing the options param from this method. |
Originally posted by @ptomato in #700
The text was updated successfully, but these errors were encountered: