Object ID's

Neil Mix nmix at pandora.com
Wed Mar 21 08:07:15 PDT 2007


On Mar 21, 2007, at 1:05 AM, Bob Ippolito wrote:

> Do you really think that people will assume that hash means perfect
> hash? I've never seen it taught or used that way. Maybe it's a common
> programming mistake that I'm blissfully unaware of?

I agree with you in the general case, but context is everything.  I  
think for many developers JavaScript Objects are synonymous with  
hashtables, and therefore it's not unreasonable to expect that a  
global hashcode method would generate keys for use in the native  
tables.  (Consider that the equivalent Java method can be safely used  
for object keys in the "native" Java Hashtable.)  Within the context  
that a developer is likely to learn about this method, there's  
nothing that makes it obviously clear that this method is intended  
for building your own hash table class, and should be avoided for  
general-purpose object keys.

I kinda doubt there will be widespread misuse of this method  
(although it's possible), but I also imagine that more than a few  
people would see it and think "wtf"?  Who knows, maybe I'm wrong.




More information about the Es4-discuss mailing list