3 ms·
Redundancy increases the the ability to detect errors, like a checksum in a code. take foo("one", "two") mis-typed as foo("one" "two"), instead of getting a "
by Chris2048 10y ago
Redundancy increases the the ability to detect errors, like a checksum in a code.
take foo("one", "two") mis-typed as foo("one" "two"),
instead of getting a "missing comma" error, you get "wrong number of arguments", unless the function can take one argument, in which case you may get some other random error.
- nailer 10y agoIf foo("one" "two") is valid syntax it's valid. If it isn't, you'll get an error. redundancy does not assist the compiler: whether the code makes a valid AST does.
- Chris2048 10y agoThe question seems to be wrt language design, and assisting the developer. It's harder to spot the error due to the flexibility in syntax. Requiring explicit "foo" + "bar", while less sugary, would mean a missing comma in the above example could be marked by a checker as an error.
- dragonwriter 10y ago> Redundancy increases the the ability to detect errors, like a checksum in a code. Redundancy also increases the likelihood of creating errors that would not otherwise have existed.
- Chris2048 10y agoThe extra typing you mean? If that increases the chance of mis-typing maybe, but it is easily detected.