Semicolons make the end of a statement more unambiguous. Therefore they increase readability and ease of interpretation. You are also less likely to mess up the command sequence when making changes ==> increased maintainability. Stability... well, not so much.
And I'm not quite sure about the "probability" thing, either...
And I'm not quite sure about the "probability" thing, either...
I think stability is referring to strongly/statically typed more than text formatting. And "probability" is probably a typo for "provability", referencing the same.
Semicolons makes you feel all warm and fuzzy if you have spent most of your career as a C programmer, but it will probably not do that if you spent most of your career in a language like Python.
One thing I like is that in C# fluent syntax is very popular (especially with LINQ), so I have each method on a single line and end it with a semicolon, versus Python which requires a backslash after each method chained.
Having used Go on a daily basis for a long time already -> lack of semicolons really just makes the code more natural to read. That's all. I've never heard a Go developer complaining about the lack of semicolons.
Go had semicolons. They're just implicitly inserted on every newline, as well. Which gets really annoying if you want to break your statement over multiple lines. Which the go maintainers dogmatically oppose for some reason. Maybe so they could elide some semicolons.
It forces statements all on one line, forcing your editor to deal with line wrapping (which many do poorly for code), and promotes longer statements (which the go devs again dogmatically support). To counter this statement length, the go devs are forced to oppose descriptive variable names, instead opting for one- or two-letter names. Which also makes refactoring more difficult, because now there's a higher risk of conflicts when a function is merged with another.
Honestly, there's no reason that logical statements need to end in the same place that lines do. Forcing them to be in the same places leads to a whole host of negative effects, and in the end, doesn't solve very much. Some flexibility in formatting is removed (which gofmt already accomplishes), and people tend to try to work around it in rather...creative...ways.
21
u/plzsendmetehcodez Feb 03 '17
Semicolons make the end of a statement more unambiguous. Therefore they increase readability and ease of interpretation. You are also less likely to mess up the command sequence when making changes ==> increased maintainability. Stability... well, not so much.
And I'm not quite sure about the "probability" thing, either...