> variables hiding instance variables a real nuisance. For example, if  
> you have a message signature with a parameter name which matches an  
> instance variable name, and the compiler produces the following
message:
>
> "warning: local declaration of '<variable name>' hides instance
variable"

What really annoyed me was that I had trivial variables called 'mxd' and
'myd' which corresponded to 'movement-x-delta' and 'movement-y-delta'.

It took forever to work out that 'myd' clashed with an enum value
defined somewhere for Date Ordering - MonthYearDay.

(It took so long because Xcode does such a crap job at displaying
multi-line error messages, and thus the 'original definition is here'
line was nowhere near the 'local names clash' line)

In this case, it wasn't instance variables, just locals vs an enum in an
enclosing scope.

Apple might think about using better (ie, prefixed) names for all their
enums if they are going to clash like this, otherwise the set of
available variable names is going to evaporate over time...

Jeff Laing <je...@spatialinfo.com>
------------------------------------------------------------------------
------
A complex system designed from scratch never works and cannot be patched
up to
make it work.  You have to start over, beginning with a working simple
system.
                 -- J Gall. "Systemantics: How systems work and how they
fail"

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to