What’s your opinion on prorgamming languages that separate lines with semicolons or those that just use a line break?

@nutomic
admin
link
5
edit-2
2Y

This makes such little difference that I dont care about it at all. There are so many more important factors when picking a language.

@doomy
link
52Y

I like languages where they are not required but can be used to delimit two statements on one line. I also like Rust in that no semicolon is an implicit return

@ff0000
link
22Y

Which is highly confusing when you are learning Rust but come from Javascript.

Dessalines
admin
link
22Y

Same, I like that implicit return too, I think some other languages have that too.

@AgreeableLandscape
admin
creator
link
4
edit-2
2Y

Personally, I’m not a fan of semicolons and prefer if languages just used line breaks. It’s one of the reasons I like Kotlin over Java.

My biggest issue with semicolons is that they don’t convey any actual information and forgetting them is annoying.

@wraptile
banned
link
32Y

I feel the same way. Good code is newline formatter anyway so semicolons tend to be completely reundandant. I like how python has optional support for them though as often I end up in python shell and need a one liner like import foo;foo.do_something()

@AgreeableLandscape
admin
creator
link
2
edit-2
2Y

Except Python is still whitespace sensitive with semicolons, so in an indented block you have to do something like function1(); function2(). In the terminal it works fine though.

Honestly, I wish they did what Ruby did and just used the end keyword.

@wraptile
banned
link
32Y

Personally I hate end keywords - seems like a such an antipattern. I’ve been using jinja html templating language for most web stuff and the end keywords caused so much headache in my career and are really ugly.

@AgreeableLandscape
admin
creator
link
12Y

So would you like it better if Python used braces?

@Decibel
link
12Y

How do you handle long variable names?
e.g. If (super…long…name1 && super…long…name2) vs. If (super…Long…Name1 && super…long…Name2)

@blamitter
link
22Y

I love typos like while(true);

@AgreeableLandscape
admin
creator
link
22Y

I feel like that shouldn’t even be allowed. Like what’s the point?

@blamitter
link
32Y

I’d say it wasn’t intended but accidental since it is possible to avoid brackets for one-line blocks in while. One could argue that the bug is in the language specs! Another could say it’s not a bug but a feature for some bizarre use. Well…

@jaex5Fox
banned
link
2
edit-2
1Y

deleted by creator

@AgreeableLandscape
admin
creator
link
22Y

What’s your favorite syntax family then?

@jaex5Fox
banned
link
1
edit-2
1Y

deleted by creator

General Programming Discussion
!programming

    A general programming discussion community.

    Rules:

    1. Be civil.

    Other communities:

    • /c/rust
    • /c/python
    • /c/powershell
    • /c/haskell
    • /c/fpcomplete
    • /c/cpp
    • /c/c_programming
    • /c/julia
    • 0 user online
    • 4 user / day
    • 13 user / week
    • 31 user / month
    • 106 user / 6 month
    • 2.53K subscriber
    • 688 Post
    • 905 Comment
    • Modlog