this post was submitted on 04 Apr 2024
369 points (95.8% liked)

Programmer Humor

32483 readers
342 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] 0 points 7 months ago (7 children)

Folks acting like Python is the only language without semicolons. 😏

I got tripped up so many time in the last 3 weeks using PHP after years in ML family languages. I am already newlining & it’d be poor style to put more than one statement on a line so what is the point of these semicolons?

[–] [email protected] 19 points 7 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] 3 points 7 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.

load more comments (5 replies)