Would you choose one language over another language for something as minor as the presence or absence of semicolon?

I hate having mandatory semicolons in a language, no matter how beautiful the language is otherwise. What about you?

2 Likes

Corresponding tweet for this thread:

Share link for this tweet.

2 Likes

What’s the big deal? I prefer that to Python’s significant whitespace.

4 Likes

I think it’s because of the habit. Most of the languages I use lack a semicolon like Ruby, Elixir, Go, Kotlin and Swift. Even JavaScript lets you get away with not writing a semicolon, even if it’s recommended to write one.

Python’s significant whitespace was the exact reason I chose Ruby over Python when I was new to web development.

3 Likes

I’m not a fan either, but I would probably judge based on overall feel or use of language :smiley:

3 Likes

Definitely prefer not to have them but wouldn’t base my choice in it. Also joining the choir of choosing it over significant white space.

5 Likes

I mean sure, not the best ergonomics but in Rust in particular the lack of a semicolon means that you want to return this expression to the caller which, albeit easy to miss for a human, is enforced by a very strict compiler that will tell you very clearly what you did wrong. So really, not such a problem as many in the past made it to be.

There are languages with not very clear error messages however and there the semicolons – and their misplacement – can be a real productivity killer.

To that I say: don’t use these languages! :wink:

4 Likes

I don’t mind semicolons. Or lack of it. What I do mind is a high number of wtf in a language.

Edit: What @dimitarvp said.

4 Likes

I don’t think it’s language which should adapts to programmers, but the opposite…

Even if a language has semicolon, space indentation or whatever, programming starts on a paper :slight_smile:

4 Likes

Few languages actually have truly mandatory semicolons (like C is one). Most semicolon usage in languages (like erlang) is actually just another operator, like <left> + <right>, but where <left> ; <right> is just the sequence operator that runs the left expression, throws away the result, then runs the right expression, and returns its result. Languages that use a semicolon as a statement terminator (like C) are indeed annoying, but when it’s a proper operator then it’s far better. ^.^

However, I don’t care one way or the other, a single token isn’t going to change a language usage for me at all.

4 Likes

I prefer semicolons ;

3 Likes

It’s just one of many things that should be considered, if it makes any difference to you. All else being equal, or at least balanced, I’d go with the one that doesn’t require semicolons – but all else is rarely equal.

4 Likes