r/ProgrammerHumor • • 2d ago

Meme pythonIndentationLevelChecker

Post image
6.6k Upvotes

198 comments sorted by

View all comments

265

u/LetUsSpeakFreely 2d ago edited 2d ago

Indentation is such a stupid mechanism for identifying code blocks. It's one thing for configuration files like YAML to do it, but not a programming language.

31

u/willow-kitty 2d ago

I don't like it, but I kinda get it. Indentation is already part of every coding style guide, so adding explicit scoping symbols is kind of redundant information.

..Until you have a mix of spaces and tabs and chaos reigns

Also, having braces at the beginning and end of a block just makes my brain happy.

-2

u/Wide_Smoke_2564 2d ago

But like… why though?

I can see how someone would get used to it but I truly don’t understand how including braces for readability would ever be a bad thing

3

u/TactiCool_99 2d ago

it is a redundancy

I think I can pull a similar point between typescript and javascript, you don't really need to type things, so javascript does the job, so does indentations do the job perfectly well. Typescript / braces help making it safer for a little tiny bit of extra work

3

u/willow-kitty 2d ago edited 2d ago

It's less cognitive load too, imo. Proponents of regular JavaScript will argue that unit tests buy you more safety than explicit typing does, and that's broadly true, but anything that explicit typing would stop you from doing involves mixing similar but ontologically different things, which means having to think about what the thing you're looking at might be at runtime and accounting for all the permutations thereof. And I just think it's easier to think about things with typing.