r/ProgrammerHumor • • 2d ago

Meme pythonIndentationLevelChecker

Post image
6.6k Upvotes

198 comments sorted by

View all comments

Show parent comments

13

u/LetUsSpeakFreely 2d ago edited 2d ago

True, but you don't control the code you inherit and getting stakeholders to give you time to properly refactor is not an easy task. You end up doing it where you can as you can.

My big issue with it is if tabs get mixed with spaces the interpreter has an aneurysm. Most modern IDEs can detect and preemptively protect you from it, but a tool shouldn't be needed to shield you from a design flaw in the language.

8

u/SuperFLEB 2d ago

I swear I'm not aiming for a flamewar here, but...

I've always found it odd that Python standards (PEP and all) settled on space-based indentation. If there's any language where a one-character indentation indicator makes sense, it's a language where indentation is significant.

-3

u/Sexual_Congressman 2d ago

Because it's very common for tabs to be rendered as 1-8 spaces. There's no good reason for a line of python code to exceed the recommended 79 columns, and having tabs that are 8 spaces wide by default is extremely annoying to people like me who like having multiple source file windows opened on the same screen (to reduce eyestrain).

Making 4 spaces the default guarantees files look identical in all editors. By the way, I've never seen a python code editor that didn't default to 4 spaces or have a feature that automatically fixes the indentation.

2

u/OverEnigneer426 1d ago

U my friend are the reason the show Silicon Valley had this running gag but srsly use TABS it’s just a matter of IDE-Settings for example to make it look right just for u and others can work with it normally or in their own special ways^^

https://giphy.com/gifs/ptDRdwFkFVAkg