3 ms·
Syntax highlighters for natural language would help against garden path sentences: For example: The old man the boat. ... is not ambiguous if written as:
by efaref 11y ago
Syntax highlighters for natural language would help against garden path sentences:
For example:
The old man the boat.
... is not ambiguous if written as:
{SUBJECT}[The old] {VERB}man {OBJECT}[the boat]
I think the reason syntax highlighting is important in programming is because garden-path style sentences are more common with the pedanticly strict grammars that programming languages require.
- WillAbides 11y agoSo you're saying English would be better as a statically typed language /s
- yorwba 11y agoThe equivalent of garden-path sentences in formal languages would be shift-reduce conflicts and most pedanticly strict grammars are specifically designed to avoid that kind of problem, so that they can be parsed efficiently.
- efaref 11y agoOf course the compiler has no problem understanding them, but humans aren't that good as parsing. The purpose of a syntax highlighter is so that the human knows that the computer agrees on what the sentence/code structure is.