Hacker News new | past | comments | ask | show | jobs | submit login

Why do language designers continue to insist on semi-colon terminated lines?



Perhaps to dissuade the lowest common denominator of programmers that get hung up on such superficial trivialities.


But it's not triviality - it's noise - Signal: Good - Noise: Bad, got it?

If you REALLY need end of line markers, any half-way competent text editor can display them for you.


You obviously have no idea what signal-to-noise ratio is about if you think semicolons are noise. Who are you trying to impress?


End of line is already encoded in source files as \n. Redundancy isn't noise, but it is redundant.


If end of line always means end of statement, by all means get rid of semi colons. If some non-trivial algorithms is used to infer end-of-statement boundaries that is more complicated than detecting end-of-line, then...there will be subtle problems.

I went through this transition before in Scala, the error messages got a lot worse after semi-colon inference was added. I wound up telling people to add semi-colons to their code when they were scratching their head at some sort of parse/type error message.


Semicolons are distracting, both reading and writing, and mostly useless. If it's not "noise" in a technical sense, is it not still a bad thing? I don't think this should be a complicated question.


It all depends on what you define as signal and what you define as noise.


Two choices dictate a terminator: (a) free form 1D language like C vs 2D language like Python or Haskell, and, (b) support for assignment statements x = y and the like as in C vs all statements starting with a keyword as in say ATS. I personally do not like the semi-colons either.


Doesn't even need to be 2D Layout. See, for instance, ruby.


It's simpler to parse and some programmers prefer them.


And simpler to parse has another benefit Given an effort X spent writing the parser, users of the language get better error messages

Also, I do not think of those semicolons as noise They make text easier to parse for humans, too That's why you see most people end sentences, paragraphs and HN posts with a 'superfluous' period

EDIT: Some people will find the above quite readable I am somewhat in that camp Problem is, however, that in English and other languages capitals like I and E are not guaranteed to be sentence starters That muddles the waters considerably Many programming languages have worse problems.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: