commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gary Gregory <garydgreg...@gmail.com>
Subject Re: [Numbers] API of "Complex"
Date Thu, 01 Feb 2018 17:41:58 GMT
On Thu, Feb 1, 2018 at 9:59 AM, Stephen Colebourne <scolebourne@joda.org>
wrote:

> On 1 February 2018 at 15:30, Gary Gregory <garydgregory@gmail.com> wrote:
> > For example, (picking a made up example) this reads really well to me:
> > Pair.of(foo, bar) because that what you'd use in spoken English.
> >
> > OTOH, this does not read well to me: Fraction.of(num, denum); this would
> be
> > better: Fraction.from(num, denum)
>
> In JSR-310, of() is used when there is little work performed in the
> factory, and relatively low chance of an error. from() is used when
> performing a complex conversion, that has a higher chance of failure,
>

I like that. To me from() implies some sort of conversion, and of() a
simple construction.


>
> Stephen
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
> For additional commands, e-mail: dev-help@commons.apache.org
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message