Path: csiph.com!news.mixmin.net!newsreader4.netcologne.de!news.netcologne.de!.POSTED.xdsl-87-79-255-186.netcologne.de!not-for-mail From: Patrick Roemer Newsgroups: comp.lang.java.programmer Subject: Re: double == double Date: Mon, 17 Oct 2016 23:11:29 +0200 Organization: news.netcologne.de Distribution: world Message-ID: References: <8737k0qd38.fsf@golem.phantasia.org> <87zim5es30.fsf@golem.phantasia.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Injection-Date: Mon, 17 Oct 2016 21:11:30 +0000 (UTC) Injection-Info: newsreader4.netcologne.de; posting-host="xdsl-87-79-255-186.netcologne.de:87.79.255.186"; logging-data="30694"; mail-complaints-to="abuse@netcologne.de" User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.24) Gecko/20100411 Thunderbird/2.0.0.24 Mnenhy/0.7.6.0 X-Mozilla-News-Host: news://news.netcologne.de In-Reply-To: Xref: csiph.com comp.lang.java.programmer:35805 Responding to 4ndre4: > On 17/10/2016 18:04, Patrick Roemer wrote: > >> Doubles are not objects in Java, which may be considered a flaw in the >> language itself from an OO point of view, so it's a bit problematic to >> use them in a discussion of good OO design. > > Well, replace double with Double in my example. It won't change the > conclusions. It would not change any conclusions, but it would be utterly besides the point, as well. The claim was that the Java Math.max() implementation is an example of "how OO is normally implemented". I have given three examples of other OO languages where the #max() operation is attached to an object. I'd consider this the "normal" OO pattern. Java is the odd one out here. I argue that this is not because the Java designers did "better OO" than the others, but rather because they were doing no OO at all, lacking any objects to orient around when working with doubles. In other cases, with objects readily available, they would do "normal" OO, just looking at Object#equals(), for example. In OO, one usually sends messages to objects, which triggers operations on their encapsulated state. Java's Math.max() is not how OO is "normally" done in my book. Best regards, Patrick