3 ms·
This is droll but I think it inadvertently makes a good point: we should be using more aids like syntax highlighting for natural language. Natural language is
by gwern 6y ago
This is droll but I think it inadvertently makes a good point: we should be using more aids like syntax highlighting for natural language.
Natural language is at least as hard to understand as artificial programming languages, and humans have (reluctantly) regularly improved the syntax highlighting of natural languages, by adding consonants, spaces, scores of punctuation marks, cases, and variant typefaces. (Consider trying to read something like ancient Hebrew in the original, written without spaces, consonants, punctuation, or lower vs uppercase - never mind italics or bolds!) Why don't we add more? Surely we did not invent the ultimate way of writing English around 1500 AD?
The primary distinction seems to be that computer languages are regular enough to be machine-annotated. If you had to hand-typeset every line of code, syntax highlighting would be used only in the rarest of CS publications. (Sort of like color-coding in equations: incredibly useful pedagogically, but also so difficult to do in HTML or TeX on top of actually writing the equations that only the occasional enthusiast or particularly-determined teacher will bother.) Natural language is such a major challenge to annotate simply by part-of-speech that you need to be a linguist to do so reliably. So naturally, no one ever does, and anyone who might want to is deterred by the fact that no one else does so readers won't understand or like it. (Beginning programmers are often confused or distracted by syntax highlighting as well.)
However, when you look at the best grammar/style checkers, or deep learning results on parsing natural language, it seems plausible that they've gotten good enough that something useful could be done with them...
- contravariant 6y agoAre you sure you're not reinventing HTML+CSS? Besides I think we shouldn't ignore the possibility that programming is highlighted too much. I'm not entirely convinced using many coloured syntax highlighting is any clearer than just well use white-space and highlighting keywords comments and strings (the latter two because they aren't part of the regular flow, the former because they heavily influences the flow of the program).
- Konohamaru 6y ago> (Consider trying to read something like ancient Hebrew in the original, written without spaces, consonants, punctuation, or lower vs uppercase - never mind italics or bolds! Semitic languages are legible without vowels. Modern Hebrew... not so much, due to its great influence from Standard Average European. This is a major problem in Israel today (people often depend on the English [really I should say Latin] transliteration to read Hebrew place names) and many Israeli linguists are advocating just switching to the Latin script. Which as a former student of Hebrew I support.
- Shorel 6y agoOh, but the path to reach an agreement about what colours should be used is dark and full of dangers.