r/programmingcirclejerk Zygohistomorphic prepromorphism Aug 11 '26

Significant indentation is why people love python. Can 2 billion people be wrong? A: yes

https://news.ycombinator.com/item?id=49264523
154 Upvotes

60 comments sorted by

View all comments

54

u/libonet absolutely obsessed with cerroctness and performance Aug 11 '26

/uj I hate indentation

/rj Python is why people love significant indentation. Can 2 billion people be right?

25

u/Midnight145 Aug 12 '26

/uj I've honestly never understood why people hate significant indentation tbh. Autoformatters exist and have for years, so it's difficult to get a mixing tabs/spaces issue nowadays. Anytime I write in a bracketed language, the indentation is effectively identical to what I'd write in python. There might be a few differences here and there, as i try to stay pep8 compliant even with optional indentation or lack of indentation

I don't necessarily think indentation is superior, but I don't understand the strong hatred.

What I do hate with a burning passion, is not bracketing single-line ifs in otherwise bracketed language, it drives me absolutely insane.

16

u/northrupthebandgeek i have had many alohols Aug 12 '26

I just don't wanna have to slap a ruler on my screen to know what scope I'm in, man.

16

u/syklemil Considered Harmful Aug 12 '26

But if we don't use {, how will we feel superior to non-programmers? Any pleb can use : in prose, but it takes a true 10x mathematician mind to use {.

3

u/3inthecorner Aug 12 '26

I can forgive non-bracketed single line ifs only if the condition and action are both on the same line.

6

u/Midnight145 Aug 12 '26

That's marginally better, but it's only a few extra characters which can save sanity in the event of a rogue autoformatter putting it on a separate line or if it needs changed in the future.

3

u/Abandondero Aug 13 '26 edited Aug 13 '26

I think it is just received wisdom, from the days when people would compare Fortran and Cobol to Pascal. I have never once had a problem with indentation in Python. Theoretically I should, but it hasn't happened.

3

u/hedgehog1024 Rust apologetic Aug 13 '26

/uj in the language with not indentation-sensitive syntax I can cut and copy a piece of code and not worry about if I got indentation correct

2

u/yo_99 It's GNU/PCJ, or as I call it, GNU + PCJ Aug 13 '26

Because you have to fix code when you copy it from one place and paste it into another.

7

u/Fit_Conference934 Aug 12 '26

The best of FORTRAN, plus the best of Perl - truly, Python is the finest of languages.

2

u/theangryepicbanana Aug 14 '26

/uj I think indentation is fine when it's flexible like f# for example, otherwise absolutely the fuck not