Live data from Hacker News

Turning off syntax highlighting

dudzik.co

51–60 of 192 posts

Re: Turning off syntax highlighting

#51
post #2

Slightly meta: Turning off the syntax highlighting entirely seems a bit hardcore to me, however, I always read each commit I do via git diff / pull request view, which does not have syntax highlighting (other than red/green for removals/additions), and I always strive to make the diff look good for each commit (which means, doing one thing at a time in each commit, and making sure it reads well). Unfortunately, not e…

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)…

> 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 use `git commit -a` a lot, but only after checking `git status` (or `git diff`), which is probably my most-used git command.

Re: Turning off syntax highlighting

#52
post #2

Slightly meta: Turning off the syntax highlighting entirely seems a bit hardcore to me, however, I always read each commit I do via git diff / pull request view, which does not have syntax highlighting (other than red/green for removals/additions), and I always strive to make the diff look good for each commit (which means, doing one thing at a time in each commit, and making sure it reads well). Unfortunately, not e…

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 get a lot of (good-natured) crap from other developers because I always use a graphical tool to view my git diffs and make commits. I realize that there are console tools like git interactive staging that provide similar functionality, but honestly I just like having a dedicated windowed application always running that is always the gateway for my code.

Re: Turning off syntax highlighting

#53

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

Surely this would make people slow down and pay attention or you know just crash more.

There was an article shared here on HN some time back about the guy who got one Dutch town to remove the warning signs on its traffic circles.

Accident rates dropped sharply.

Re: Turning off syntax highlighting

#54
I worked for years with SimpleText/TextEdit on the Mac (Classic/OS X) and Pico on the server.

I felt syntax highlighting was a gimmick that distracted me from my Monaco 10 with no anti-alias perfection. If I needed to do some repetitive editing beyond a simple find/replace, I'd write a small shell script. I was kind of proud of my minimalism. You can do a lot with native Carbon/Cocoa key bindings alone. Life was good.

Then someday I saw a video of someone doing crazy work in Vim. Flying. I had to learn that. I forced my self to use Vim exclusively for one job, from beginning to end. I kept watching similar videos to get over the nightmarish frustration that is anyone's first week or so in Vim. But after that, I was completly hooked.

However, I still have warm feelings when I open some code in TextEdit. Black, 10px Monaco text over a 90 by 30 white background. Ah.

Re: Turning off syntax highlighting

#55
post #47
post #11

I only color comments and strings.

Same. Works well for me e.g. http://i.imgur.com/RMrslmu.png

Comments and literals (numbers, strings, NULL, etc) here. http://imgur.com/a/kRbhG

I tried no-syntax-highlighting for a while, but found that a little bit is nice.

Re: Turning off syntax highlighting

#56
post #44
post #34

Earlier quoted context omitted.

> I also consider `git add -A` to be horrible > practice. Adding files manually makes you tons more > aware Agreed, but I take it further than that - I always use `git add -p` because it forces me to read through everything, and make everything in the commit deliberate. Even if you think you just made a slight change to a file or two and definitely want everything, you'd be surprised how often it lets me pick up some…

I am in the other extreme: I always use `git add -A` (but I read the diff before) and avoid doing more than one thing in the first place (which would make me want to use `git add -p`). IMO it is an antipattern to do bazillion changes at once, and then do several commits out of it (unless you really know what you're doing) - because you commit a state of the repo that (probably) never existed. I prefer to do change, c…

> because you commit a state of the repo that (probably) never existed

The state doesn't exist in the repository until the code has been committed - so your statement is a little backwards. Sure the code might never have only had that edit in it, but the repository has no changes until a commit is made.

Re: Turning off syntax highlighting

#57
post #14

syntax off, proportional width, ( https://twitter.com/rob_pike/status/567476552187641856 ), all code right aligned, ZWS for tabs

Proportional fonts + elastic tab stops [0]. I would love to have this working. Unfortunately, if you really depend on elastic tab stops you break the formatting for everybody who does not use it.

[0] http://nickgravgaard.com/elastic-tabstops/

Re: Turning off syntax highlighting

#59
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…

Agree with this 100%. If you can do everything you want on the CLI then more power to you, but in my experience people using the CLI for diffs/staging include unrelated code in their commits at a much higher rate. I checkout/branch/pull/push in the CLI, and use Git Tower to diff and stage.

Re: Turning off syntax highlighting

#60

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

Surely this would make people slow down and pay attention or you know just crash more.

Right, but realistically they'd just crash more and then what's been achieved? Some of us get to feel smug about how the daft plebs aren't hard-core enough to navigate without colored traffic lights?
Post reply on HN