this post was submitted on 04 Apr 2024
254 points (96.4% liked)

Programmer Humor

32143 readers
561 users here now

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

founded 5 years ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 17 points 5 months ago (1 children)

In some languages
a newline does not
necessarily indicate
the end of a statement.

In others, sometimes it could, but would leave things ambiguous
as to whether the statement was ended or not.

And so, punctuation is necessary.

[–] [email protected] 2 points 5 months ago

But newlines + indentation are supported by a lot of languages & when it is, it’s easier to read since the prevailing convention is already to newline, then in indent. When you follow the usual coding styles or autoformatted & removed the semicolons, you’ve gained nothing for readability & added noise. I much prefer the languages that take this convention & bake it in so you don’t have to have that that visual noise—and in these languages, I never felt the parsing rules were ambiguous.