Re: Deprecated method documentation
Re: Deprecated method documentation
- Subject: Re: Deprecated method documentation
- From: Patrick Machielse <email@hidden>
- Date: Thu, 13 Nov 2003 21:44:29 +0100
op 13-11-2003 16:05 schreef Fritz Anderson op email@hidden:
>
On 12 Nov 2003, at 4:23 AM, Patrick Machielse wrote:
>
>
> Why not let the compiler warn us about deprecated methods
>
>
Because Objective-C is a dynamically-typed language. NSString may
>
deprecate the cString message, but MyOwnClass may have a message named
>
cString that is still perfectly valid. The recipient of a cString
>
message may have a compile-time type of id, referring to an NSString, a
>
MyOwnClass, an object that doesn't understand cString at all, or nil.
>
An Objective-C compiler would have no way in principle to distinguish
>
deprecated uses from nondeprecated.
I agree that there may not be a 100% solution, but it would certainly be
nice to get a compiler warning when trying to send 'cString' to any
_staticly typed_ object of type NSString. That's the whole point of static
typing, isn't it? You want to supply the compiler with as much information
as possible to let it help you. In the case of 'cString' I guess 95% of the
time objects are actually statically typed 'NSString', so deprecation
checking would catch most instances. (Even if it would catch just 1 instance
of a deprecated method, it would inform the programmer of the issue)
Patrick machielse
_______________________________________________
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.