<div dir="ltr">I'd say too that this makes intuitive sense based on algebra. If we have:<div><i>instant1</i> + <i>duration</i> = <i>instant2</i></div><div>then we can subtract <i>duration</i> from both sides:</div><div><i>instant1 = instant2 - duration</i><br>or we can subtract <i>instant1</i> from both sides:</div><div><i>duration = instant2 - instant1</i><br><br>There's no manipulation we can do that would cause us to try to add instants together, and it's a bit surprising for the API to allow the first subtraction but not the second.</div><div>I also think that if I see instant2.minus(instant1) it's immediately obvious to me what that means, while instant1.until(instant2) seems both less discoverable and less obvious.</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, 2 May 2024 at 10:29, Louis Wasserman <<a href="mailto:lowasser@google.com">lowasser@google.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">That doesn't follow for me at all.<div><br></div><div>The structure formed by Instants and Durations is an <a href="https://en.wikipedia.org/wiki/Affine_space#Definition" target="_blank">affine space</a>, with instants the points and durations the vectors.  (An affine space is a vector space without a distinguished origin, which of course Instants don't have.)  It is 100% standard to use the minus sign for the operation "point - point = vector," even when "point + point" is not defined, and to use all the other standard idioms for subtraction; the Wikipedia article uses "subtraction" and "difference" ubiquitously.</div><div><div><br></div><div>Personally, I'd be willing to live with a different name for the operation, but consider "users keep getting it wrong" a strong enough argument all by itself for a version with the swapped argument order; it's not obvious to me that another API with the same argument order adds enough value over Duration.between to bother with.</div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, May 2, 2024 at 10:04 AM Stephen Colebourne <<a href="mailto:scolebourne@joda.org" target="_blank">scolebourne@joda.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Thu, 2 May 2024 at 15:58, Kurt Alfred Kluever <<a href="mailto:kak@google.com" target="_blank">kak@google.com</a>> wrote:<br>
> instant − instant = duration // what we're discussing<br>
> instant + duration = instant // satisfied by instant.plus(duration)<br>
> instant - duration = instant // satisfied by instant.minus(duration)<br>
> duration + duration = duration // satisfied by duration.plus(duration)<br>
> duration - duration = duration // satisfied by duration.minus(duration)<br>
> duration × real number = duration // satisfied by duration.multipliedBy(long)<br>
> duration ÷ real number = duration // satisfied by duration.dividedBy(long)<br>
><br>
> All but the first operation have very clear translations from conceptual model to code. I'm hoping we can achieve the same clarity for instant - instant by using the obvious name: instant.minus(instant)<br>
<br>
But you can't have<br>
 instant + instant = ???<br>
It doesn't make sense.<br>
<br>
This is at the heart of why minus isn't right in this case.<br>
Stephen<br>
</blockquote></div><br clear="all"><div><br></div><span class="gmail_signature_prefix">-- </span><br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div>Louis Wasserman (he/they)</div></div></div>
</blockquote></div>