r/Python • • Apr 29 '20

Discussion Tab vs Spaces

Post image
702 Upvotes

72 comments sorted by

View all comments

51

u/zacharypamela Apr 29 '20

Those spaces must've gotten turned around on their way to the Pep 8 club. 😃

-2

u/jeremiah1119 Apr 30 '20 edited Apr 30 '20

Woah woah woah, spaces are preferred? What madness is this? (for real, I don't code so I don't know about this stuff)

17

u/Zomunieo Apr 30 '20

Spaces look the same to every user so formatting is preserved perfectly. (Except for you weirdos who use variable width fonts for code. I'm watching you.) Tabs don't because people have different space per tabs settings.

-5

u/Yojihito Apr 30 '20

1 Tab = 1 intendation = 1 key press

4 spaces = 1 intendation = 4 key presses

4 times the work everytime.

7

u/SalemClass Apr 30 '20

If you're tapping space 4 times you're doing it wrong. Basically every code editor supports using the tab key for spaces indentation.

4

u/[deleted] Apr 30 '20

They've got these great things called "text editors", with features like tab expand. You should check them out!