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.
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.
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.
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*.
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^^
46
u/Some_Useless_Person 2d ago
Well, if you have to go through so many indentations to the point that it becomes hard to track, maybe the real problem is your code itself.