Traffic lights should be monotone and drivers should just know what position means what. Whatever metaphor you use, this is just dumb.
Syntax Off (2012)
41–48 of 48 posts
Re: Syntax Off (2012)
#42Is using and tags syntax highlighting for text? Personally I program Clojure, so there's not a lot of syntax to highlight--well, more than in scheme, for example--but I couldn't imagine life without brace matching (a dynamic kind of syntax highlighting).
Re: Syntax Off (2012)
#43It reduces productivity and adds headache. Code is not a textbook. A good programmer has to always look at different pieces of code and would lose himself in the mess of symbols if there is no indents and block highlights..
And if he's meaning to compare it to prose, while they typically lack color (due more to the means of printing than the format, check out old manuscripts and they use color quite often), they use punctuation and other methods of emphasis like bold, italics, size, and underlining.
Re: Syntax Off (2012)
#44> The lack of syntax highlighting was a bit of a shock at first, but I found over a day or two that I began to get used to it. Once you're used to the lack of color, go all the way and use a proportional font.
Re: Syntax Off (2012)
#45Ever since I spent a week wondering why my main loop only ran 3 times, I always turn syntax highlighting on. This is what my code looked like: // Initialise for (i=0;i Syntax highlighting would have shown the problem instantly. In fact, the bug would never have happened. Anything that can increase the chance to catch an error is a good thing. [EDITED for code formatting.]
Re: Syntax Off (2012)
#46Code is read more often than it's written, but it's skimmed more often than it's read. So making it easy to mentally jump around code without actually reading it is extremely valuable.
I've found this particularly valuable in Haskell because it lets you use arbitrary things in infix position. Now, this by itself is valuable for the same reason: it helps structure the code, neatly separating the operation from its arguments. Some things just make more sense infix. But visually, it's often hard to grasp when something is infix. This is not too bad with operators:
foo bar baz + qux 11 quux
but it's actually rather difficult with normal words infix: map solve problems `using` rpar rseq
Now compare this to the highlighted version: http://jelv.is/img/hs-syntax-hl.pngThe most important part of the above snippet is how "using" divides into two clear parts. And yet, on something like HN, this is a bit hard to follow: "using" looks like another word in a string of words--this is exactly what I want to avoid with the infix syntax!
In Emacs, at least, infix symbols--both operators and names in backticks--get highlighted in a different color. This immediately make the structure of the above code completely clear. Then, when I'm glancing through it, I can focus on the part I care about. (This example is particularly appropriate because the two halves do completely different things--the left one defines the computation and the right one specifies how to parallelize it; chances are I only care about one of the two at a time.)
I think that highlighting operators also explains why I've never had any real difficulties with Haskell's "symbol heavy" code.
This could be extended to a bunch of other structural distinctions I care about. For example, when reading Lisp code, I would love to have macros and functions highlighted differently. Macros generally represent some sort of code organization where functions are often part of the actual program logic; moreover, macros and functions behave very differently.
Re: Syntax Off (2012)
#47> When I read a book, I don't want parts of speech highlighted in different colours Books don't have syntax highlighting, but having never read a book that does, I can't say one way or the other that it is a terrible idea. And actually, as I think about it more, books would be a nicer reading experience if conversations were highlighted, and if key person/place names where in a different color. (Just like text in RPG…
And some books do do these things. Often thoughts are italic whereas spoken words are quoted. Pratchett puts Death's words in all caps.
Re: Syntax Off (2012)
#48"When I read a book, I don't want parts of speech highlighted in different colours" I do! In long conversations in novels I occasionally lose track of who is currently talking; normally it's really obvious as the next page of text doesn't make any sense until I backtrack to find where the speech got switched, though one time I finished a whole book where my protagonist had the wrong gender because I didn't realise th…
> In long conversations in novels I occasionally lose track of who is currently talking Perhaps the actual story narrative needs to be clearer, by repeating the speaker's name more often.
I don't seem to have much problem with this in English, but it causes me no end of grief reading in a non-native language, I suppose because my grasp of context and eye for other cues is much shakier...
[I've read books where I'll get halfway through the book before realizing my entire conception of what's going on has been completely wrong due to confusion over who said something in the beginning of the book... I'll go back, re-read the crucial dialogue with the speakers swapped, and suddenly everything starts making sense... TT ]