Live data from Hacker News

Turning off syntax highlighting

dudzik.co

181–190 of 192 posts

Re: Turning off syntax highlighting

#181
post #37

Earlier quoted context omitted.

I agree completely. On that note, I also consider `git add -A` to be horrible practice. Adding files manually makes you tons more aware of what changes you actually made, and also prevents you from accidentally adding extra files you don't want. I also recommend people to look at the Linux kernel git history for good examples of how to use git well. Even if you have no knowledge of kernel code (and most people don't)…

I just don't understand why people use the git CLI. Git is too powerful a tool, using the CLI limits one of two things: your capabilities, or your productivity. Often times I see my coworkers screwing around with git trying to review diffs and commit their changes. One of two things happens: they spend longer than they should doing it, or they do it haphazardly. Sometimes they get it wrong. Just use a GUI. I use Sour…

Yeah that's what I used to think but you have at understand that typing and keeping your fingers on the keyboard is often way faster than moving around and clicking various regions of the screen.

Then what happens when they update their GUI? Oh you have to learn it all over again.

That being said, I do on occasion open a GUI if I have to do a complicated merge or something like that but for basic operations why would you need it.

Re: Turning off syntax highlighting

#182
post #25

I think a large part of the issue with syntax highlighting is that our "standard" for syntax highlighting is rather dumb. A few thoughts: - Who the hell would write prose by making all the verbs blue, the nouns red, and the adverbs green (or something to that effect). That's what we do for code. Something togglable a-la iA Writer might make sense, though. At the same time, I can sort of understand, though, because we…

> One project I'd love to see is to get a bunch of folks together to do some proper layout-by-hand on code -- Given 100% control over typography, how would you format it to maximize readability, minimize distraction, highlight relevant contextual knowledge, etc? And then work to push tools in a direction that they support configuration to allow for said tasks.

I've had a similar thought for several years now. Want to hash out some ideas? You can contact at my site wanderingstan.com or on twitter @wanderingstan.

Re: Turning off syntax highlighting

#183
post #7

No thanks. The last time I could bare not using syntax highlighting I was still on MS-DOS. Since Turbo Pascal 7 (released in 1992), syntax highlighting is a must have on my programming environment. But I understand when we are talking about vim, people prefer an hardcore experience.

You understand wrong. When that author typed ":syntax off" in Vim, he was actually disabling possibly the best syntax coloring engine there is.

I don't understand how that make pjmlp wrong in any way?

Being hardcore doesn't imply that the syntax coloring is bad.

Re: Turning off syntax highlighting

#184

Not this again "We should remove all color from traffic lights and make people remember which position is what"

The difference here is that on a traffic light the colors are important and inherent to the traffic light's functionality. This is not true in source code. Syntax highlighting "helps" you to spot strings, numbers, keyword arguments etc. faster. But normally this is not what programming is about.

> The difference here is that on a traffic light the colors are important and inherent to the traffic light's functionality.

They're really not. See also: millions of red-green colorblind people.

The top one is stop, the bottom one is go.

Re: Turning off syntax highlighting

#185
I'd argue that you could learn to read code carefully, understand what it's doing, and write good code without losing the convenience of syntax highlighting.

Unless the color scheme you were using really was so garish that it hindered your ability to improve your skills as a software engineer, in which case you could probably find a more subtle color scheme that would give you the same benefits as turning it off did. I've heard great things about the solarized color schemes. I use wombat myself.

Re: Turning off syntax highlighting

#186

Not this again "We should remove all color from traffic lights and make people remember which position is what"

The difference here is that on a traffic light the colors are important and inherent to the traffic light's functionality. This is not true in source code. Syntax highlighting "helps" you to spot strings, numbers, keyword arguments etc. faster. But normally this is not what programming is about.

I think you've done a better job supporting the other side. The direction and order is important and inherent to the traffic lights functionality, not the color. The color merely helps identify state. Colorblind people can drive fine without knowing which is red and which is green.

The point of colors in syntax highlighting, to me, is not to have a handicap, it's to read the code at the fastest speed possible. No one who is so new to an editor or a language should have the unrealistic expectations to understand the colors and read at full speed in their first hour of gazing.

Re: Turning off syntax highlighting

#187
post #64
post #37

Earlier quoted context omitted.

I just don't understand why people use the git CLI. Git is too powerful a tool, using the CLI limits one of two things: your capabilities, or your productivity. Often times I see my coworkers screwing around with git trying to review diffs and commit their changes. One of two things happens: they spend longer than they should doing it, or they do it haphazardly. Sometimes they get it wrong. Just use a GUI. I use Sour…

As a counterpoint, every time I've tried a git GUI (I've tried lots), I end up bashing my head against it within a few minutes. They usually make very basic things easy and anything even slightly outside the box basically impossible. I'm much more productive using a couple of git commands that I can type in a few seconds, rather than hunting for things in menus and dialogs for ages. > committing individual lines or c…

i use a gui for two things:

1. gitk is the handiest way to undo the occasional accidental commit ("reset index, leave working tree untouched"). yes, i know there's bound to be a CLI way; no, i can't be bothered to look it up and remember it when i have gitk right there and it's not a mainstream use case.

2. git-cola does interactive commits way better than the console interface does.

Re: Turning off syntax highlighting

#188

Earlier quoted context omitted.

> Given 100% control over typography, how would you format [code] to maximize readability There was a book on this, whose title I'm blanking on. Anyone remember? Color wasn't an element, since it was an older book focusing on printing on paper.

Kinda rings a bell for me, although not from a book, but some LaTeX manual. Maybe this helps: http://tug.ctan.org/macros/latex/contrib/algorithm2e/doc/alg...

That wasn't it, though that looks relevant for anyone thinking of working on this problem. Thanks for the pointer.

Re: Turning off syntax highlighting

#189

Earlier quoted context omitted.

> Given 100% control over typography, how would you format [code] to maximize readability There was a book on this, whose title I'm blanking on. Anyone remember? Color wasn't an element, since it was an older book focusing on printing on paper.

Bjarne Stroustrup's C++ book used a proportional font with tabular spacing.

So did the book I was thinking of, but it tried more fancier stuff too and iirc reported on some experiments in code reading.

Re: Turning off syntax highlighting

#190
post #160
post #152

Earlier quoted context omitted.

Did you have any thoughts of your own about the before/after experience? Or did you simply imitate them on the basis of learning an unrelated trick?

Yes. Maybe. I don't think I was thinking about it that way. I think it was more like "look at how readable this is[1]", and when I opened it on my own computer all the bright colours were suddenly very distracting so I turned it off. I would sometimes use ed to make changes to programs since I can see what I was working on before I needed to make a change, so I don't think it was doing anything for me, but at the sam…

That seems pretty reasonable - if you can see that someone else can do something you can't, and you don't know how, then there's no harm seeing what they do differently to you and trying that just in case. Correlation doesn't imply causation but it does suggest the possibility.

I know I prefer a much more muted colour scheme now than I used to. I still like my syntax highlighting but it's more hinting than glaring RGB confetti.

Post reply on HN