[almighty] Equaler considered harmful

Andrew Lee Rubinger alr at redhat.com
Thu Sep 22 19:07:47 UTC 2016


On Thu, Sep 22, 2016 at 3:01 PM, Thomas Mäder <tmader at redhat.com> wrote:

>
> On 09/22/2016 05:35 PM, Andrew Lee Rubinger wrote:
>
>> What does the implementation of this look like? Its usage?  Because now
>> to achieve your point 4) we've moved the responsibility of determining
>> equality from the object in question to some external equality-checker.
>> How does the equality-checker know about the various types it has to
>> support?
>>
>
> You will still need an implementation per object type. For example, if you
> wanted to implement a Set like in Java, you would have to pass in an
> equality implementation to the Set to tell it what to consider "equal"


So then the instance of this object compares two things you've provided to
it as parameters.  Which to me isn't really an instance method at all
because it has nothing to do with the state of the instance being invoked.
:)

S,
ALR


>
> /Thomas
>
>


-- 
Red Hat Developer Programs Architecture
@ALRubinger
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/almighty-public/attachments/20160922/e2456a36/attachment.htm>


More information about the almighty-public mailing list