4 ms·
Colour can help carry information. It is a lot easier to identify strings if you use colours rather than just rely on seeing opening and beginning quotes. I k
by aroberge 14y ago
Colour can help carry information. It is a lot easier to identify strings if you use colours rather than just rely on seeing opening and beginning quotes. I know that I find it very useful - and even more so my choice of colours for comments making them blend more in the background and making it easier to forget.
I would liken it to the use of boldface letters to represent matrices (or vectors) in some math textbook: without this convention, you have to rely a lot more on memory to know what each symbol represents. Mathematicians and physicists everywhere have found this to be useful.
When you have a huge majority of programmers using syntax highlighting, you have to ask yourself if there is not an instrinsic value to its use and, if so, perhaps try to use it to communicate with the larger community, rather than adopting a cliquish practice.
- mseepgood 14y agoMy suspicion / theory is that most programmers turn on syntax highlighting for the same reason that they have desktop wallpapers: to make their lifes more colorful.
- cma 14y agoWhen your externally mandated build process is really slow, you appreciate things like easily noticing an unclosed quote, or a missing */ that was supposed to close a comment.
- Mr_T_ 14y agoOne of the main selling points of Go is that builds are fast.
- Mr_T_ 14y agoTo be honest, I often feel as if I was in a brothel on some blogs with CoffeeRubyNodeScript highlighting. (However, the choice of colors on this one isn't too good either)
- flogic 14y agoThat's a perfectly valid reason in and of itself.
- alangpierce 14y agoGood language-aware syntax highlighters do a lot more than highlight keywords and other syntactic things, and can make code more readable in a nontrivial way. For example, Eclipse's Java editor will color things differently based on the scope you pull it from, which lets you distinguish local variables, non-static fields, static fields, and inherited fields. It does a similar thing for method invocations, including a strikethrough for methods marked as deprecated. This saves having to manually go to a bunch of definitions in order to get the proper context when reading code you're not familiar with.
- jimbokun 14y ago"I would liken it to the use of boldface letters to represent matrices (or vectors) in some math textbook: without this convention, you have to rely a lot more on memory to know what each symbol represents." This is an excellent comparison, as programming languages probably have more in common with mathematical notation than natural language prose.