3 ms·
If your editor can do that, so could the compiler. So, why require them? The only reason I can think of would be readability, but I haven’t seen a language whe
by Someone 6y ago
If your editor can do that, so could the compiler.
So, why require them? The only reason I can think of would be readability, but I haven’t seen a language where that is a serious concern (scala gets close with its “there must be a blank line here” at times)
I think “no semicolons” nowadays is the option to go for.
- ketralnis 6y ago> If your editor can do that, so could the compiler. So, why require them? So that there's a step in between where the human can check the result
- Rusky 6y agoEditors can get away with things compilers can't- they are inherently interactive. If your editor gets it wrong, you can just fix it. If your compiler gets it wrong, you might get an error message, or weird behavior. This is, for example, a major philosophy behind Rust's well-regarded error messages. The compiler rarely makes this kind of choice behind your back- instead, in reports an error message with a suggested fix-up for what it thinks you mean (and editor integration can apply those automatically). Then the program source remains unambiguous and clear, there are fewer ways to confuse readers, but you still get all the benefits of "if your editor can do that, so could the compiler."