4 ms·
I'm not sure if red and green necessarily have a negative and positive connotation to me. First, red and green are often colors for + and - and second, you can
by hydrolox 4y ago
I'm not sure if red and green necessarily have a negative and positive connotation to me. First, red and green are often colors for + and - and second, you can read the code you need and see why it was deleted.
- marcosdumay 4y agoIt's funny, because those colors were clearly picked exactly because they have their positive and negative connotations, used as a metaphor for literally positive and negative changes. That's the same reason people use them on numbers too.
- secondcoming 4y agoBut deleting code (a red diff) is the most positive code change anyone can make
- Izkata 4y agoThink of it more as state instead of transition: The code in red was bad so it had to be replaced with the good green code.
- smegsicle 4y agothe cultural association makes it easier to parse- a red diff is clearly very good because lots of bad code (red) is being removed (red) if your boss looks at a red diff and thinks it's bad, that's a you and him problem, while the primary purpose for color syntax continues to be making it easier to parse for people who know what they're looking at
- marcosdumay 4y agoIt's literally negative. You are removing things. It may add value, so may be figuratively a very positive change. But not literally.
- csydas 4y agoI would agree, the connotations come from internal classifications from the reader, and the classifications just don't bear scrutiny in most cases. A red apple is not inherently bad nor is a green apple inherently good. A person might enjoy one versus the other to eat, but if you just ask someone to identify attributes of an apple, the color likely won't prompt statements about the good/bad nature of the apple, and instead would decide the apple's use based on your needs. This can be done with just about any color association and at its core, people will include the context when considering the associations. Red machines are better because they're faster, after all, even if you're not making a WH40k joke. I think the author of the article overstates the implicitness of the associations they make with red/green and propose that everyone has such strong associations. When I read a diff, the color doesn't matter, I just need to know what it indicates. I set my terminal colors and syntax highlight colors not to indicate some specific judgement on the colors, but because I want different things to stand out so when I am scanning. Bright red stands out well in general, so it's useful for errors so I catch it when scrolling, which typically are what I'm interested in if I'm checking a log. Based on my primary interest, I pick the other colors that are complimentary to red or opposing to help quickly categorize. With diffs, I am interested in what got the axe typically, because first I want to see "what did we have before?"; it's very difficult to judge if what was added is an improvement without knowing the context of what was replaced, so for me, it makes sense to focus on what was originally there, then see what was changed. This is naturally _my_ association and interpretation, and frankly it could work with any scheme assuming the colors were different enough.