[almighty] Equaler considered harmful

Rob Cernich rcernich at redhat.com
Thu Sep 22 19:20:02 UTC 2016


I've only loosely been following this, so I don't understand completely the use case, but what is wrong with Comparator? Or implementing a pattern similar to what you have in C++? 

</ducks> 

----- Original Message -----

> 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

> _______________________________________________
> almighty-public mailing list
> almighty-public at redhat.com
> https://www.redhat.com/mailman/listinfo/almighty-public
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/almighty-public/attachments/20160922/521442ad/attachment.htm>


More information about the almighty-public mailing list