<div dir="ltr"><div dir="ltr">Em qua., 10 de set. de 2025 às 11:54, Stephen Colebourne <<a href="mailto:scolebourne@joda.org">scolebourne@joda.org</a>> escreveu:</div><div class="gmail_quote gmail_quote_container"><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
1) Basic - add/subtract/multiply/divide/negate<br>
Used by BigDecimal/BigInteger<br></blockquote></div><div><br></div><div>To me, style 1 communicates "update" -- x.add(y) -- add y to x, update x by adding y.</div><div>It would confuse me if "add" did not update x.</div><div>Following Stepanov in "Elements of Programming", I think of this as "accumulator style".</div><div><br></div><div>For immutable data types, I think style 2 communicates "new value".</div><div>In my own arithmetic code, I use sum, difference, product, quotient and remainder; division produces a pair; inverse, half, twice or double etc.</div><div><br></div><span class="gmail_signature_prefix">-- </span><br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div>Pedro Lamarão</div></div></div></div>