4 ms·
A programming language with no redundancy in it means the compiler cannot detect any errors - because every sequence of characters forms a valid program. The s
by WalterBright 4y ago
A programming language with no redundancy in it means the compiler cannot detect any errors - because every sequence of characters forms a valid program.
The skill is in selecting the optimal amount and form of redundancy.
For example, the typical ; statement terminator is redundant. People often ask, since it is redundant, why not remove it? People have tried that, and found out that the redundancy makes for far better error detection.
- lmm 4y agoOn that specific example, not my experience at all. (The general point is of course valid, though I think it follows very directly from what I said)
- pharmakom 4y agoSemicolon is a strange example when so many successful languages don’t have them. I think a better example is CoffeeScript, where almost any string is a valid program but probably not the one you wanted.
- WalterBright 4y ago> Semicolon is a strange example when so many successful languages don’t have them. They usually have another statement terminator instead, like a newline.
- amelius 4y agoNo, with redundancy your compiler can catch a certain class of errors (call them "avoidable") that doesn't exist in case of no redundancy. Of course, in both cases you still have the unavoidable errors.