3 ms·
When there's a close match between a lexical rule and a semantic rule, it's easier to remember how to use the semantics. Most languages have an arbitrary rule
by vorg 11y ago
When there's a close match between a lexical rule and a semantic rule, it's easier to remember how to use the semantics.
Most languages have an arbitrary rule for distinguishing between an identifier (it begins with letter, except for 30 to 80 special cases) and keyword (30 to 80 special cases) which is hard to remember. When the rule is that the first character of an alphanumeric sequence determines whether it references a number (it begins with digit) or identifier (it begins with letter), that's easy to remember. Golang extends that idea by also distinguishing between public (beginning with uppercase) and private variables in this way, but it still falls short on its rule for recognizing the 50-odd keywords and special identifiers.
Languages that have simple lexical-semantic matches enable people to program in it without IDE's or other crud.