5 ms·
I don't understand the reasoning behind this. What possible benefit could you get from turning off all syntax highlighting? It's useful to distinguish between
by whack 11y ago
I don't understand the reasoning behind this. What possible benefit could you get from turning off all syntax highlighting?
It's useful to distinguish between language keywords and user specified names. Being able to visually ignore one of them, while focusing on the other, is a tremendous benefit. It cuts down the number of things you need to hold in your head at once, by half.
It's useful to distinguish between local variables and instance variables. It helps to better understand the dependencies that exist between a method and other methods/state.
It's useful to distinguish between mutable variables, and constants. It tells you at a glance how something is being used, and the pitfalls you need to watch out for.
Turning off all syntax highlighting destroys all of the benefits above, and I can't think of any notable benefit you would get out of it.
I guarantee you, whatever "upside" you think you're feeling right now, it's simply the novelty effect. This is a very common phenomenon in AB testing. Often times, you see an initial improvement, simply because users respond positively to the initial novelty of something being different. I guarantee you, if you continue to work without syntax highlighting for 6 months, and then turn it back on for a few weeks, you'll realize how much you actually love it.
- coldtea 11y ago>I don't understand the reasoning behind this. What possible benefit could you get from turning off all syntax highlighting? He explained his reasoning (and theories why it would work) in enough detail. You might disagree, but I can't see how you can't understand it. >It's useful to distinguish between language keywords and user specified names. Being able to visually ignore one of them, while focusing on the other, is a tremendous benefit. It cuts down the number of things you need to hold in your head at once, by half. That's the conventional thinking. The whole point of TFA is that it's not useful -- rather it's distracting, making eyes automatically focus in such distinctions while losing the bigger picture. Plus, just because you've colored "language keywords and user specified names" doesn't mean it's now easier to "visually ignore" one of them while focused on the other, it can mean the exact opposite: the extra color distraction makes you jump from one to the other -- unless you put extra conscious effort.
- whack 11y agoYes, I read his reasoning, but I still can't make sense of it. The most common theme seems to be that having more colors is "distracting". I mean yes, having more colors gives your eyes more things to process... the same way that 7 letter variable names creates more work for your eyes compared to 2 letter variable names. But if someone told me that they avoid naming their variables using complete words because it's too distracting, and only used 2 letter symbols, I wouldn't understand that either. From a physics/math perspective, yes, I get that "more" implies more entropy. Having 4 colors on your screen is more entropy compared to 2 colors. Having 7 letter names is more entropy than having 2 letter names. But if that additional entropy is used to convey clear, unambiguous and useful information, it actually makes the overall message simpler. The same way that long/descriptive variable names make reading code simpler compared to random 2 letter symbols. On more reflection, the one reasoning I can somewhat understand, is the idea of handicapping yourself. If you force yourself to type with one hand behind your back, it gives your brain additional incentive to find concise solutions. In theory, I guess I understand this line of reasoning, but in practice, I'll still continue typing with both hands, thank you very much. Anyway, just thinking aloud here. When I come across something I don't understand, I try my best to understand what the other side might be thinking. Not trying to attack anyone... to each his own. Best wishes.
- callahad 11y agoI found the Alice in Wonderland image at http://www.linusakesson.net/programming/syntaxhighlighting/ http://www.linusakesson.net/programming/syntaxhighlighting/ particularly compelling, in support of the argument that highlighting may emphasize syntax at the cost of obscuring semantics.
- jasode 11y agoI've not found that Alice analogy colorizing the "verbs" convincing. With human language like English, we learn it and use it without the formal grammar++. A 5-year old child can speak to her mother ("I want some candy!") without conscious knowledge of "verbs" or "nouns". A formal grammar for categorization is what we layer on top of language for analysis in school. Two people can communicate and understand each other without any exposure to any grammar lessons. So yes, colorizing verbs looks superfluous and noisy.[2] On the other hand, computer programming syntax starts with grammar. You learn that certain specific tokens are "data types" and other tokens are "literals", etc, etc. And that grammar categorization in programming languages never goes away as you're typing out new code. (Otherwise, you'd get a compiler error or unintended behavior because x="3"+"5" with quotes ("35") means something different from x=3+5 without quotes (8).) This is why so many programmers find color highlighting helpful even if they've been programming that language for 10+ years. Sure we want to focus on higher cognitive purpose of "semantics" but the grammar is deeply intertwined with reconstructing what the semantics is. A closer analogy of color highlighting in a different realm would be different colors in TCPIP traces such as "red" highlighting external ip addresses. This can be helpful for forensics of malware phoning home. Or in financials dashboards where uptrends are "green" and downtrends are "red". The same reasons that colors help the malware analyst or stock trader quickly parse data at a glance is also how it helps programmers. ++ (at least not consciously that a 5-year old would be self-aware of it. A theory of innate universal grammar in the brain by Chomsky isn't what I'm talking about.) [2] except for rare examples of using annotation or coloring of verbs to help parse sentences like this: https://en.wikipedia.org/wiki/Buffalo_buffalo_Buffalo_buffalo_buffalo_buffalo_Buffalo_buffalo https://en.wikipedia.org/wiki/Buffalo_buffalo_Buffalo_buffal...
- pjmlp 11y agoIt is an hipster thing, coding without syntax highlighting, no completion, only CLI and the original Vi.
- shitgoose 11y agoor it is a reaction to too much syntax highlighting, overloaded toolbars, endless contextual menus and general sophistication that penetrated every pore of software development. as one of the comments here quoted: "syntax highlighting, while aesthetically seductive, moves focus from content to form". Sums up the state of art in IT.
- pjmlp 11y agoI have been using syntax highlighting since Turbo Pascal 7.0, it has never been a problem.
- black_knight 11y agoI have been without syntax highlighting for two years now, and I don't miss it. Have tested using it again, but feelt it distracting. For me the main advantage is that without the colours it is easier to see when a certain part of the code is 'ugly'. With syntax highlighting on, everything is a soup of colors anyway. Also, when highlighting makes comments light gray and almost invisible, it is easy to leave a commented-out mess of old code around. When comments are given the same emphasis as real code I care more about them, and make them tidy too. I don't find the extra information provided by colours useful. I'd rather spend five seconds going back to the declaration of the variable (in my editor, it is a simple right click to jump between usages of a string), which will also remind me of its type and the context it was introduced, since if I am unsure about its scope, chances are there are more aspects of the item which I am unsure of.