this post was submitted on 04 Apr 2024
12 points (92.9% liked)

Programmer Humor

32481 readers
267 users here now

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

Rules:

founded 5 years ago
MODERATORS
 
top 22 comments
sorted by: hot top controversial new old
[–] [email protected] 3 points 7 months ago

That's actually me removing semicolons from Python.

[–] [email protected] 2 points 7 months ago (2 children)

How does one manually add a semicolon? vs. automatically?

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

Manually would be if it prompted you every time you every time the program inserts one. No, wait...

[–] [email protected] 1 points 7 months ago

JS formatters add them if the project requires it

[–] [email protected] 2 points 7 months ago (1 children)
[–] [email protected] 3 points 7 months ago

I;don't;think;that;helps

[–] [email protected] 1 points 7 months ago

I was taught python by my school but I would rather write in other languages but the difference in formatting still gets me after years

[–] [email protected] 1 points 7 months ago (1 children)

For bonus points take their code and completely go wild with utterly random indentation and line breaks, just to drive the point home. 😈

[–] [email protected] 0 points 7 months ago (1 children)

Pfff just randomly replace tabs with 4 spaces and see the world burn

[–] [email protected] 1 points 7 months ago (1 children)

4 spaces is the preferred pythons is happy with either but the standard is 4 spaces. Vscodium ensures that.

[–] [email protected] 0 points 7 months ago (1 children)

Your editor is happy with either, but is it happy with both?

[–] [email protected] 1 points 7 months ago (1 children)

My editor will take either and convert it to 4 spaces. Python can use spaces or tabs but not both in the same file.

[–] [email protected] 1 points 7 months ago (1 children)

Buahahahah I know what to do next commit

[–] [email protected] 1 points 7 months ago (1 children)

Its the python equivalent of a Greek question mark

[–] [email protected] 1 points 7 months ago

I have a plugin in VSCode to remind me not to forget the semicolons

[–] [email protected] 1 points 7 months ago

This is why linting and auto-format on save exists in IDEs. Don't make things harder on yourself.

[–] [email protected] 1 points 7 months ago* (last edited 7 months ago)

~~Python~~Amateur programmers

[–] [email protected] 1 points 7 months ago (1 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] 1 points 7 months ago

it’d be poor style to put more than one statement on a line

Unlike Python, most languages do not endorse a specific concept of style. You're free to dabble in all the bad style choices you like, on the off chance that once in a blue moon they prove to be situationally useful.

[–] [email protected] 1 points 7 months ago

can I interest you in some delicious linters

[–] [email protected] 1 points 7 months ago

I was brought up on C, did a module of Java at uni, and am doing an algorithms course which is python heavy.

My other half - who's quite handy with Python - looks in sheer horror at my code which is littered with semicolons.

I was stumped for half an hour figuring out why the Python interpreter was bouncing an error before it had even reached the main program logic... turns out a { before the block of code royally ruins the interpreter's day.

Still, I live and learn.