Live data from Hacker News

Syntax Off (2012)

kyleisom.net

1–10 of 48 posts

Re: Syntax Off (2012)

#4
This reminds me of something I've heard Douglas Crockford propose in the past: syntax highlighting would be more useful [in some languages] if it was used to color different scopes.

Re: Syntax Off (2012)

#5
TL;DR - no syntax highlighting means you have to read the code to avoid syntax errors, and that keeps it more present in your head.

Which is true, we used to joke that the C compiler on a VAX was so slow that you wanted to be really really sure it wasn't going to throw some crappy syntax error so you read through your code twice before submitting it. But a friend of mine from the Amiga community showed me that iterating fast often lead to faster code development than slower iteration. In both cases having your code in your head made for a better result, but someone who could iterate fast and hold the code in their head, always out performed the person on the slow path.

It can be hard to develop the discipline though.

Re: Syntax Off (2012)

#8

This reminds me of something I've heard Douglas Crockford propose in the past: syntax highlighting would be more useful [in some languages] if it was used to color different scopes.

I already do this in Sublime Text, it's very useful when you may have PHP and HTML in the same file. It's also useful with the much less common HTML with CSS or JS.

Re: Syntax Off (2012)

#9
I believe this is worth thinking about, because if the syntax highlight is only to disguise whenever the syntax is incorrect, you could only highlight it when it is incorrect, and modern IDE's (vim including) are capable of doing this.

On the other hand, perhaps highlighting the syntax is to represent the structure of source code, or make it more readable. There is also a text highlight utility for text, called BeeLineReader (http://www.beelinereader.com/)

Re: Syntax Off (2012)

#10
"The best way I can describe it is to compare it to reading a book. When I read a book, I don't want parts of speech highlighted in different colours. What I want to do is to read the book, to take in the information."

I found this interesting, as my reaction has been almost the complete opposite. I've never felt that syntax highlighting played a part in understanding code at a high level. Syntax highlighting is there for when I'm reading my code like a copy-editor. It (along with an inline linter) is there to make syntactical errors more obvious so I can deal with them as I make them.

Post reply on HN