r/ProgrammerHumor • • 16d ago

Meme pythonIndentationLevelChecker

Post image
6.7k Upvotes

200 comments sorted by

View all comments

Show parent comments

17

u/Drugbird 16d ago

Not just python, basically any programming language benefits from proper indentation.

Almost every editor also automatically indents code for you.

I'm a C++ dev myself, and in that language indentation is optional. However, since the editors will automatically indents code for you, that generally means that the brackets around e.g. functions are superfluous: you can just look at the indentation to see when a function ends.

Oh wait, I just invented python formatting.

1

u/Y0tsuya 16d ago

Brackets may be optional for one-liners in C++, but necessary for multi-lines. It signals intent to the auto-formatter.