5 ms·
> If your software outputs color by default, please consider not doing so. Why? What specific benefit does that convey to my users? When I decided to color the
by usrbinbash 3y ago
> If your software outputs color by default, please consider not doing so.
Why? What specific benefit does that convey to my users? When I decided to color the output, I did so for a reason, otherwise I wouldn't have gone through the trouble of doing so.
There is exactly one use case for this, and that's programmatically processing output in a pipline. And that one is a solved problem, as good libraries for colored output usually check isatty()
And before anyone says "colorblindness": I think if someone is colorblind, they are likely to have set up their terminal in a way that deals with colored output already.
- andreareina 3y agoI don't remember what was the last instance of a command barfing ansi escape sequences into a non-tty output stream, but it was just a couple days ago. I encounter badly-behaved software more frequently than your seem to, and I have more confidence in "don't provide colour (or other fancy text) unless the user asks for it" than "it's fine except for this set of exceptions that who knows if it's complete or not".
- FeepingCreature 3y agoSure, but that has a simple solution not even mentioned in this post: isatty(1)
- account42 3y agoJust remember that stdout and stderr can be both a tty, neither a tty or one is a tty while the other is not.
- ori_b 3y ago> Why? What specific benefit does that convey to my users? Readability, reduced visual noise, and compatibility with any terminal color scheme. > When I decided to color the output, I did so for a reason, otherwise I wouldn't have gone through the trouble of doing so. Was your reason something other than preference? If not, did you consider that others may have different preferences?
- riversflow 3y ago> Readability, reduced visual noise, Semantically colored text, by definition, reduces visual noise. After doing a bit of googling there are infact a number of studies that show that colored text seems to positively affect both short term free and serial recall.
- ori_b 3y agoThen, by definition, most use of color in the command line is not semantic, because it increases visual noise for me. You may like color, that's fine. But for me, the effect of colored text as it is used today is akin to prose with every other word randomly colored[1], often in a color that blends in with the background of the page. Turning off the colors, for me, is a large improvement. Using them sparingly, carefully, with a preference for bolding and italicizing to make metadata stand out from data, would be better. This is far harder to patch in to most programs, and a much larger uphill battle. Turning off colors is, by and large, the low hanging fruit. [1] https://cdn.gbraad.nl/images/blog/english-text-highlighting.png https://cdn.gbraad.nl/images/blog/english-text-highlighting....
- tgv 3y ago> Semantically colored text, by definition, reduces visual noise. Not by definition. It adds information. If that matches the text 100%, it is redundant. If it isn't, it adds noise. So it depends very much of what you consider "noise". > After doing a bit of googling there are infact a number of studies that show that colored text seems to positively affect both short term free and serial recall. I'm curious what you think are good sources for that. Many studies have been done on color and text, but I've never seen one that gives a good argument in favor of coloring command line output. Note: recall isn't a goal of color in (most) command line output. Perhaps there is some case, but I wouldn't know which one.
- account42 3y ago> If that matches the text 100%, it is redundant. If it isn't, it adds noise. Information is only noise if it isn't the signal you are after. Also if the text contains some information that doesn't mean color can't make it easier to distinguish.
- pessimizer 3y ago> When I decided to color the output, I did so for a reason, otherwise I wouldn't have gone through the trouble of doing so. This is the truth about every decision one makes, even if the reason is trivial, fleeting, or barely overruled some opposing reasoning, which shouldn't mean that no one can suggest anything to you. This is someone trying to affect your future decisionmaking, not to take the decision from you. > I think if someone is colorblind, they are likely to have set up their terminal in a way that deals with colored output already. Maybe they're not on their home machine or terminal?