3 ms·
WHAT, always use four spaces instead of TAB?? Oh my god.
by iamsanteri 4y ago
WHAT, always use four spaces instead of TAB?? Oh my god.
- GavinAnderegg 4y agoFor reference, this has always been the recommended style in PEP 8 (initially published in 2001). https://peps.python.org/pep-0008/#indentation https://peps.python.org/pep-0008/#indentation
- iamsanteri 4y agoJesus christus
- jstx1 4y agoI feel like I'm either too young or somehow sheltered to understand why people care about this. Hasn't it been very standard for a while now to press the tab key and have your editor insert 4 spaces?
- iamsanteri 4y agoYeah, probably. I'm not so comfortable with all the whitespace in Python, but the thought of having to tap space 4x constantly while writing code is so hugely off-putting to me as an idea. I'd rather just continue pressing tab a single time, all the time, until the day I die.
- sdrothrock 4y agoI don't think anyone taps space four times; they just set tab to insert four spaces. So from a typing perspective, there's no difference. It's a pretty standard setting in every editor I've used, including vim.
- LtWorf 4y agoDo you have to press tab 3 times if you're inside blocks? Do you use notepad.exe or something more ancient like edline?
- guilherme-puida 4y agoEvery single editor has some equivalent to `expandtab`, so you just use that instead of pressing space x times.
- omoikane 4y agoIn comparison, Godot's python-like GDScript prefers tabs: https://docs.godotengine.org/en/stable/tutorials/scripting/gdscript/gdscript_styleguide.html?highlight=tabs#encoding-and-special-characters https://docs.godotengine.org/en/stable/tutorials/scripting/g... I have come to appreciate tabs here, but you have to have already established tabs as the prevailing convention for this to work.