Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I used to swear by syntax highlighting, but then I tried turning it off after hearing of someone else who tried and never went back.

That was five years ago. It felt weird for about ten seconds. These days I find code with syntax highlighting very noisy and almost impossible to deep read.

It's quite possible that it was always like this, but that I was numbed to the effects and lacked reference points.

Whatever the case, I don't miss it at all.



I also tried coding without syntax highlighting but it only lasted a few months.

One of the downsides is that when you show your code to other developers who don't have the necessary visual bandwidth, they get uncomfortable.

One of the few things syntax highlighting actually helps with is for catching typos in keywords. (To the trained eye, this could be replaced with just bolding or italicizing the keywords.)

Today I'm using "the colorful words" again (as non-technical associates have described syntax highlighted code), and still looking for a syntax highlighting theme which does not look like crap. (Gruvbox is the closest I've gotten yet.)

Giving each identifier its own color (e.g. https://medium.com/@evnbr/coding-in-color-3a6db2743a1e) is another interesting idea.


I strongly recommend trying a middle ground. I find nearly all highlighting schemes in use today overly garish, so I always find myself customising my own with relatively few colours with the idea of doing as little as possible to bring out the structure of the code:

- Comments and string literals can look like code without being code, so they get their own separate colours to make it easier to quickly scan past to where they end.

- Types live in a different dimension from the rest of the code, and tell me a lot about what it does, so they get a different colour.

And, finally, the one I've been trying for a while but am still not convinced about:

- Structural keywords (for loops, branches, etc.) get a separate colour as well.

All these colours are of course relatively neutral. I'm especially confused by people who use bright red for anything. That's a colour I use extremely sparsely for actual errors and bugs.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: