Re: [Numbers] API of "Complex"

2018-02-01 Thread Gilles
On Thu, 1 Feb 2018 10:41:58 -0700, Gary Gregory wrote: On Thu, Feb 1, 2018 at 9:59 AM, Stephen Colebourne wrote: On 1 February 2018 at 15:30, Gary Gregory 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 spok

Re: [Numbers] API of "Complex"

2018-02-01 Thread Gary Gregory
On Thu, Feb 1, 2018 at 9:59 AM, Stephen Colebourne wrote: > On 1 February 2018 at 15:30, Gary Gregory 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

Re: [Numbers] API of "Complex"

2018-02-01 Thread Stephen Colebourne
On 1 February 2018 at 15:30, Gary Gregory 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,

Re: [Numbers] API of "Complex"

2018-02-01 Thread Gary Gregory
Hi All: I like the "of" prefix but I think it might be odd to force the convention for ALL factories. It might be an English language thing for me. 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 d

Re: [Numbers] API of "Complex"

2018-02-01 Thread Gilles
On Thu, 01 Feb 2018 13:59:13 +0100, Gilles wrote: Hi. IMHO, there are too many accessor and factory methods. We should strive for a lean and consistent API. For the factory methods, I suggest the "of" convention: public static Complex ofCartesian(double re, double im) public static Complex of

[Numbers] API of "Complex"

2018-02-01 Thread Gilles
Hi. IMHO, there are too many accessor and factory methods. We should strive for a lean and consistent API. For the factory methods, I suggest the "of" convention: public static Complex ofCartesian(double re, double im) public static Complex ofPolar(double abs, double arg) And, as syntactic sug