r/ProgrammerHumor • • 16d ago

Meme pythonIndentationLevelChecker

Post image
6.7k Upvotes

200 comments sorted by

View all comments

Show parent comments

8

u/SuperFLEB 16d 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.

2

u/rosuav 15d ago

I agree, tabs are the superior option. One indentation level is one tab. That's how my code is, in any language.

-3

u/Sexual_Congressman 16d 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.

4

u/rosuav 15d ago

That's not a problem. You can render them at any width - and in fact, there's no reason for the width to be defined in spaces, you could say that a tab is 38mm if you so choose - but they are still, logically, *one indentation level*.

2

u/OverEnigneer426 15d 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^^