> On Jun 2, 2015, at 2:41 PM, Jens Alfke <j...@mooseyard.com> wrote:
> 
>> On Jun 2, 2015, at 12:13 PM, Charles Srstka <cocoa...@charlessoft.com 
>> <mailto:cocoa...@charlessoft.com>> wrote:
>> 
>> That can be handy, if you’re not colorblind. If you are, the coloring isn’t 
>> much help.
> 
> 
> It depends on what the colors are. Almost no one is entirely colorblind; 
> usually it’s just red and green that are problematic.

And since red and green are two out of the three cones in your eyes, that 
leaves blue, and shades of it, as the only really easily distinguishable color.

I can tell blue from red or green pretty easily. Red from green is a problem. 
Blue from purple is a problem. Green from brown is a problem. There are many 
other color combos that can also be mistaken from each other. It’s easiest just 
not to rely on colors.

I can tell red and green apart, of course, if they’re right next to each other 
for contrast, like Yosemite’s window buttons, and if there’s a sufficiently 
large patch of the color (it was easier with the larger Snow Leopard-style 
buttons, but still possible with Lion/Yosemite). If you just showed me one of 
the window close buttons by itself, I would have trouble telling you whether it 
was red or green. With the skinny little lines that make up text (or line 
graphs, which I really hate), it’s next to impossible to tell the colors apart 
without using Digital ColorMeter, even if they’re right next to each other.

> But yes, you might be a dog, with no color vision at all. In that case you 
> can configure syntax ‘coloring’ to use different text styles or even 
> different fonts. So you could highlight ivars with italics or underlines or a 
> serif font or something.

Dogs don’t completely lack color vision. Also, calling a person a dog could 
really come across in a way that you’re not intending.

Anyway, yes, one could ugly up one’s code with italics and boldface and 
whatnot, but simply prefixing the ivar name with an underscore is simpler, it 
prevents accidentally referencing the ivar and/or shadowing it with a local 
variable, and it’s what Apple recommends. Better all around, if you ask me.

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