3 ms·
It's a trade-off. You can either assume all statements end at the end of the line, and require a continuation character (backslash in Python) if that isn't the
by Denvercoder9 5y ago
It's a trade-off. You can either assume all statements end at the end of the line, and require a continuation character (backslash in Python) if that isn't the case; or you can require a statement terminator (semicolon/closing brace in Rust) for all statements.
The downside of assuming statements end at the end of the line is that you need to have special rules for when that isn't the case (such as Python's implicit statement continuation inside braces), while always having a terminator is simpler and more consistent (all statements end with a semicolon) at the cost of extra characters.
- zuj 5y agoThanks, this makes perfect sense. Python we are using \n instead of ; as the statement terminator. Just didn't got what you mean by "python's implicit statement continuation inside braces" ?