r/ProgrammerHumor • • Oct 17 '26

Meme pythonIndentationLevelChecker

Post image
6.7k Upvotes

201 comments sorted by

View all comments

Show parent comment

172

u/bobbymoonshine Oct 17 '26

Ah the halcyon days before LLMs

When 30% of the posts here were “lol Python is so dumb why even use whitespace as syntax”

And the other 70% were “how do I find semicolon”

16

u/mothzilla Oct 17 '26

In both Javascript and Python, semi-colons are optional.

31

u/AppropriateOnion0815 Oct 17 '26

Only that JS is handling semicolons in the least intuitive and irrational way possible.

5

u/mothzilla Oct 17 '26

Yeah I only say it because it's a bit of a mind-exploder.

7

u/SuperFLEB Oct 17 '26

I'd always figured it was/thought of it as an error tolerance that worked well enough that some people started leaning on it. The whole no-semicolons JavaScript thing just seems really hipsterish. Explicitness is a virtue.

11

u/Loading_M_ Oct 17 '26

In JS, semicolons are technically required but automatically inserted. There are a couple edge cases where they get inserted in surprising places, which is generally worse than python's approach.

E.g. the following function doesn't return a value:

function foo() {
  return
    some_long_complex_expression();
}

(It's because a semicolon gets inserted after the return). At least in typescript, this would typically show a type error, as long as the function's return type annotation isn't void.

3

u/Ambivalent-Mammal Oct 17 '26

I admit, this got me more than once.

8

u/dalziel86 Oct 17 '26

Javascript sucks ass too

13

u/LetUsSpeakFreely Oct 17 '26

Meh, Go didn't use semicolons.

18

u/NatoBoram Oct 17 '26

It was a revelation when I started programming. "What, it doesn't have to be this way? A language can be native, statically compiled and high level at the same time and not suck ass? We can do better as a species?"

Except it's the only one like that -_-

9

u/LetUsSpeakFreely Oct 17 '26

And the channel system, native markup support, baked in web service support are incredibly useful.

The only thing i don't really like is how interfaces aren't declarative on types.

4

u/Loading_M_ Oct 17 '26

Rust is also in this category. It even has a lighter runtime, since it doesn't require a GC.

2

u/cdrt Oct 17 '26

It does require semicolons though

1

u/Loading_M_ Oct 17 '26

Yes, except when you want an implicit return.

3

u/wrecklord0 Oct 18 '26

(may I (introduce you '(the world of lisp)))

2

u/readf0x Oct 17 '26

Odin is also a high level native language! Well, not as high level as Go since it's manual memory management but definitely easier than C. I'd recommend checking it out I love it personally

3

u/Bulky-Ad7996 Oct 17 '26

Surely there must be a way to automate indentation

1

u/ILikeLenexa Oct 17 '26

WHITESPACE didn't use anything but whitespace.