1. 23

A repost of the author’s 1998 article before it’s lost in the ether, plus reflections on the debate 18 years later.

  1. 14

    One kind of syntax highlighting that I have found useful is “rainbow parentheses” which makes it easy to figure out which delimiters are paired together by highlighting different levels of nested delimiters different colors. This is more important for very parenthesis intensive languages, like lisp, but is also useful for things which end up nested more than once or twice. I find I spend less time counting parentheses and more time programming.

    1. 19

      I think that the main reason I use syntax highlighting is because I enjoy it. If I did not, I suppose I probably wouldn’t.

      I don’t really think people have stopped arguing about it though. I still see broadly unsubstantied claims about the alleged cognitive overhead or whatever other pseudo-scientific malarky. Oh, and perennial sigh factory Rob Pike still calls it (and users of it) childish, as far as I can tell.

      1. 4

        I think Pike’s gripes about it are that it only highlights the obvious things like keywords, rather than easily confused things, like assignment (=) and equality (==) in C, for example.

        1. 4

          I think the reason I originally started using it was purely aesthetic - syntax highlighting looks better (to my eyes at least!). I think the first editor that I used that had it must’ve been one of the Borland editors of the early 90s, maybe Turbo Pascal 7.0 or Turbo Pascal for Windows?

          The other benefits only came later for me - faster code comprehension, quick spotting of errors, etc.

          Here’s the Rob Pike quote:

          Syntax highlighting is juvenile. When I was a child, I was taught arithmetic using colored rods (http://en.wikipedia.org/wiki/Cuisenaire_rods). I grew up and today I use monochromatic numerals.

          From this post to golang-nuts.

          1. 6

            That Rob Pike says this means nothing. I mean, I admire the guy, but unless this is backed by solid science, it is just a matter of opinion and taste. I’ve seen some articles about attention fatigue, and how potentially reducing the colors will allow you to focus more and longer; I’d be curious if a study was actually made with software developers, writing code, using colors as visual cues for what is what. Different coloring helps me (I feel) navigate the “layout” of the code better. Here’s a flow-control keyword and an associated block, for example, becomes easier to spot without actually having to read yet. Anyway. No science from me here. Carry on.

        2. 7

          I used to have pretty strong opinions on syntax highlighting and the editor that one uses. I grew out of that. Today I totally don’t care what editor (vi,emacs,mg) or IDE I use and whether it has syntax highlighting or not - I just swap between them like crazy.

          I may no longer be super effective and optimizing every key stroke, but I’m having more fun in using what I want and thinking about the code and not the tool.

          I’m the same with browsers and WM’s/DE’s. It just doesn’t matter in the end. Whatever is enough to get the work done is great.

          1. 3

            Anyway, this argument is now finished. Whether people use it or not, they no longer find the need to argue about it. This is a nice example that sometimes these ridiculous arguments eventually go away.

            I dug up a comment I wrote about two years ago, which was a counterexample to this, but honestly I feel too chastised to link it. The argument probably should be forgotten. :)

            1. 1

              Why is important to have this discussion 18 years later? I just don’t get it. It seems like a waste of time to have this arguments.