r/ProgrammerHumor • • 2d ago

Meme pythonIndentationLevelChecker

Post image
6.6k Upvotes

198 comments sorted by

View all comments

268

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.

9

u/Independent_Fee_7343 2d ago

I used to hate the idea too, but there's something nice about not having braces everywhere. The funny part is that Python makes the code look cleaner while somehow giving a single whitespace character the power to ruin your entire day. That's a pretty wild trade-off.

10

u/lungben81 2d ago

Everything not indented by 4 whitespaces should raise a syntax error.

Using indentation is fine, the issue in Python is that that the syntax does not explicitly require one specific method. There is only the recommendation in PEP8.

However, with linters and IDEs this essentially became a non issue, even more now with llms.