On Jun 1, 2015, at 11:43 PM, Britt Durbrow 
<bdurb...@rattlesnakehillsoftworks.com> wrote:
> 
> Although I have the luxury of requiring modern runtime capable systems, some 
> people do still have to target the old runtime…

ARC requires the modern runtime, which has pretty much caused the old one to 
drop off the map for most people, I think.

> Also, FWIW the modern runtime only handles same-named instance variables that 
> are privately declared; same-named variables declared in an @interface 
> section will conflict even on the modern runtime.

Variables declared in an @interface section trigger a compiler warning:

warning: declaration of instance variables in the interface is deprecated 
[-Wobjc-interface-ivars]

> Oh, and there’s a nifty warning that’s thrown as soon as you try to declare a 
> local variable of the same name as an instance variable.

That doesn’t help if I’m looking at some code that someone else wrote, or code 
that I wrote 5 years ago, noticing a variable name being used somewhere, and 
having to hunt around for the declaration to figure out whether it’s a local 
variable, an instance variable, or something stupid like a global or something.

>> On Jun 1, 2015, at 3:14 PM, Charles Srstka <cocoa...@charlessoft.com 
>> <mailto:cocoa...@charlessoft.com>> wrote:
> 
>> 
>> Non-underscored ivars vs. local variables, however, are not obvious at all, 
>> especially if the method is large.
> 
> In modern versions of Xcode at least, if I don’t know exactly what I’m 
> looking at, the answer is just a command-click away… :-)

That can be handy, when it works. Sometimes it doesn’t (particularly when 
you’re using Swift, in which command-click usually just brings up an endless 
circular progress indicator).

> Also, the syntax highlighting does render (at least on my setup) in different 
> colors for local variables and instance variables.

That can be handy, if you’re not colorblind. If you are, the coloring isn’t 
much help.

Charles

_______________________________________________

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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

Reply via email to