Live data from Hacker News

A case against syntax highlighting

linusakesson.net

1–10 of 25 posts

Re: A case against syntax highlighting

#2
Syntax highlighting? Programmers these days rely on Intellisense, with tooltip help explaining parameters and return values as they type.

Back in my day we were lucky to have an EDIT command in our BASIC interpreter. Back in the day of someone much older than me, patching binary files directly was the norm. How would programmers today even cope, should they ever be confronted with a hex editor or worse, a front-panel bank of toggles?

Re: A case against syntax highlighting

#3

Syntax highlighting? Programmers these days rely on Intellisense, with tooltip help explaining parameters and return values as they type. Back in my day we were lucky to have an EDIT command in our BASIC interpreter. Back in the day of someone much older than me, patching binary files directly was the norm. How would programmers today even cope, should they ever be confronted with a hex editor or worse, a front-panel…

I'm admittedly a newb, but I find that a lot of my programming includes trying to think in a good way and then reading documentation to figure out how to implement it.

So far it has applied to every technology I've used. :p

Re: A case against syntax highlighting

#5

Syntax highlighting? Programmers these days rely on Intellisense, with tooltip help explaining parameters and return values as they type. Back in my day we were lucky to have an EDIT command in our BASIC interpreter. Back in the day of someone much older than me, patching binary files directly was the norm. How would programmers today even cope, should they ever be confronted with a hex editor or worse, a front-panel…

That comparison doesn't make sense. You forget that the frameworks we use today to parse XML has more complexity than the entire OS had then. We are able to do so much more today, on code bases several thousand times larger, because we have these tools.

Re: A case against syntax highlighting

#7
The bright primary colors on black shown in the post are distracting. More subtle colors make a difference. I find syntax highlighting incredibly helpful. Seeing instantly if you forgot to close a quote. Seeing comments ( as the author points out) are two examples.

I'm one of those developers that likes to have an IDE with as many helpers as possible. And before anybody accuses me of being a newb, I started out programming pascal & working on vax on a dumb terminal. And I had to walk uphill both ways to get to the computer lab. So put that in your pipe and smoke it young whippersnappers!

Re: A case against syntax highlighting

#9
There's at least two phases of developing code. There's the solving of the problem at hand, and getting the expression of that solution towards syntactically correctness.

Colour syntax highlighting is merely a "live syntax checker" - albeit not as good as a compiler or linter (it's simpler in nature). But the value it adds is sufficient to make it a useful aid. It's the coding equivalent of Word's squiggly red line spell-checker, it draws attention to things that may be issues when the colour highlighting looks odd.

If the colours are distracting, then it is the colours that are the issue, not the concept of syntax highlighting. So subdue them enough.

Colour syntax highlighting is a visual indicator that the code looks syntactically correct. With that as a confidence indicator it's easier to dive into the logic itself, knowing that you're mostly on solid ground syntax wise.

Plus, colour provides quick visual hooks to various parts of the code. It allows skimming through the code to find the prescient part easier. Yes, it makes it easier to skip past commented out code -- those should be deleted at an appropriate point. And it's easier to delete that commented out code when it's colour coded than without.

Developers fight with their code on multiple levels. Colour-coding helps deal with one particular level of that code - syntactic correctness.

Developers know that syntactical correctness doesn't mean the problem is solved. It just means that the attempted solution to that problem is considered syntactically correct.

I think the only interesting point in the author's piece is the point that English text is more difficult to read when it's randomly coloured. When we get to an x-Generation Language levels where we can develop programs in plain English, I'd agree with the author that colour syntax highlighting doesn't add sufficient value at that point. But we are still stuck in a hybrid computer-friendly constrained language constructs, and with those constrains, colour syntax highlighting assists developers to confirm the code is syntactically valid.

Re: A case against syntax highlighting

#10

Syntax highlighting? Programmers these days rely on Intellisense, with tooltip help explaining parameters and return values as they type. Back in my day we were lucky to have an EDIT command in our BASIC interpreter. Back in the day of someone much older than me, patching binary files directly was the norm. How would programmers today even cope, should they ever be confronted with a hex editor or worse, a front-panel…

I did a quick survey of a dozen or so engineers here and 0 use IDEs/Intellisense and 100% use syntax highlighting.
Post reply on HN