Re: NSDictionary design bug (was: Re: Ugly bug in Foundation, beware!)
Re: NSDictionary design bug (was: Re: Ugly bug in Foundation, beware!)
- Subject: Re: NSDictionary design bug (was: Re: Ugly bug in Foundation, beware!)
- From: Malte Tancred <email@hidden>
- Date: Wed, 9 Jun 2004 09:36:09 +0200
On 7 jun 2004, at 23.43, Patrick Machielse wrote:
op 07-06-2004 14:20 schreef Alastair Houghton
MyObject fulfils all of the requirements stated for -isEqual: and
-hash, and
it is the *NSDictionary* that is storing a different key to the one
that it
was given, *not* the user.
The code above will work for a well designed key class. It is the user
that
broke the implicit 'copy is equal' contract for MyObject.
Yes, according to the documentation of NSDictionary. But that's exactly
what's being discussed. Marcel objects to the design of NSDictionary.
Someone mentioned the word elegance, hoping that _it_ was not what this
discussion was all about. In my experience, programming is all about
elegance. If introducing an NSDictionary superclass that would function
the way Marcel advocates indeed elevates the elegance of the Foundation
kit, that introduction should definitely be made; If changing the
behaviour of NSDictionary to agree with what Marcel suggests, and at
the same time introducing a subclass with an intention-revealing name
(ie, revealing the current NSDictionary behaviour) would elevate the
design even more, then that change should be made instead.
Regards,
Malte
--
Malte Tancred
Computer Programmer
Oops AB,
http://oops.se/
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.