I understand that semicolons indicate the end of a line in languages like Java, but why?
I get asked this a lot by other people, and I can't really think of a good way to explain how it works better than just using line breaks or white space.
I understand that semicolons indicate the end of a line in languages like Java, but why?
I get asked this a lot by other people, and I can't really think of a good way to explain how it works better than just using line breaks or white space.
Not, nor everyone. Furthermore, many popular languages like Python, Ruby, or Visual Basic, don't use semicolon as end of statement but line breaks. Many, not "everyone", still uses semicolon because historical reasons, not rational argumentation: semicolons had a important role to replace the punched-card format in first age of computation, but today it can be totally discarded.
In fact, there're two popular ways of specify an end of statement:
\
in Python) to say that the statement has not finished.In order to make a code more readable, using a special character to specify an end of statement should be an exception, not the rule.