7

A coworker was using spaces instead of tabs in python 🤦‍♀️

Comments
  • 5
    Everyone I know uses spaces instead of tabs in Python. In fact, PEP8 says uses spaces instead of tabs (https://python.org/dev/peps/...), with the community using four spaces per indentation level.

    If you're talking about pressing the spacebar instead of using the tab key to insert spaces, then that deserves a wk99 tag. Otherwise, your coworker is correct.
  • 3
    @Null-Device
    Key difference is spaces are universal white space, where as tabs can be interpreted as 4-6 spaces depending on IDE and OS.

    Even Github will do some strange things at times with tabs so when you’re doin peer reviews the indentation can become hard to follow.

    Safest way is to use an IDE that allows you to press TAB but will insert n+spaces, this allows “space” fans to get what they want and you keep pressing that tab key.
  • 1
    @Null-Device doesn’t bashing the space so many times get to you?
    It drives me nutty hearing the “tap, tap, tap, tap” for a single indent.
  • 0
    @Null-Device just checking
  • 1
    @mojaveazure most people just set the tabs to 4 spaces so you don't have to keep pressing the space bar
  • 0
    I’ve taken to setting my editor for 2 space tabs.. four is a bit silly. Especially when the rest of pep8 calls for 80 column lines like it’s the 80s and were all on glass terminals.
  • 0
    I press tab because don't want to press 4 times spaces, IDE knows me very well he puts four spaces for me automatically
Add Comment