Hacker News new | ask | show | jobs
by goatlover 2519 days ago
Or as an unnecessary end of statement character to clutter up your code with.
1 comments

> Or as an unnecessary end of statement character to clutter up your code with.

To the benefit of compiler writers, in detriment of everyone else.

I've come in to fix bugs caused by ASI many a time. Having an explicit character to denote the end of a statement is much more valuable than people pretend.

And don't get me started on meaningful whitespace vs brackets.

> Having an explicit character to denote the end of a statement is much more valuable than people pretend.

No, I'm not talking about automatic semicolon insertion. I'm talking about _ not having semicolons at all _.

Many languages are like that – in fact, almost all languages which are not descendants of the C branch.

I think you quoted the wrong part of the message there, but I understand.

Still, without a line terminator you either have to use newlines, which sometimes will help make cleaner code and sometimes will make a mess of temporary variables and such. Or you have ambiguity, which is why I bring up the the anecdotes about fixing ASI errors.

Which makes it interesting that the Go creators, being heavily into C before, decided to ditch the end of statement semicolon.