From: Elliot Temple Date: 2006-06-27T02:37:30+09:00 Subject: Re: Ruby and Java equality usage On Jun 26, 2006, at 10:20 AM, Robert Klemme wrote: > 2006/6/26, Robert Dober : > >> Personally I find this situation a bit odd. I'd prefer a single >> > equivalence relation per class not two. >> >> Although I do not feel the same that seems a normal concern, as I >> pointed >> out to the OP. >> Honestly I think it depends on the programming culture we are >> coming from >> and when >> in our mind these are synonyms we are likely to get bitten by that >> kind of >> code. > > At the moment I'm not so sure whether culture is the background. I > tend to think that there's a more fundamental issue: having a single > equivalence relation defined on instances of a class seems to make > things easier in several areas and I believe that it rather reduces > programming errors. Perhaps the issue is not so much having more than one, but having unhelpful names for them. We don't get confused by the variety of each-like methods available. And no one forgets the difference between times, upto, and downto, despite their similarities. If we had ==, same_place_in_memory, same_in_hash, and same_object_id (or whatever they are) people wouldn't get confused even with lots of them. -- Elliot Temple http://www.curi.us/blog/