Tab vs. Space | Sololearn: Learn to code for FREE!

+1

Tab vs. Space

Is it better (cleaner, efficient, faster etc.) to tab indentations or use spacebar. Discuss.

7/10/2016 10:16:31 PM

D M

6 Answers

New Answer

+3

Well, according to the Python's philosophy: Beautiful is better than ugly. Explicit is better than implicit. Simple is better than complex. Complex is better than complicated. Readability counts. It's up to you... however if you want a clean, beautiful and readable code you should tab indentations; its let you read easily the code, identity the blocks.

+3

The python style guide (PEP 8) recommends spaces. I always use 4 spaces.

+1

I personally prefer tab, but many people like 2-3 spaces. It's up to personal preference.

+1

tabs can be displayed differently in different editors while spaces are constant. apart from that,i dont think there is much difference.

+1

tab or 4 spaces either one is recommended

+1

using tabs may cause problems when changing editors,or pasting ur code to a page,or sending it to some1 else to edit.but I prefer tabs to spaces for speed.quick fix for the errors is that most editors have an option to convert tabs to 4 spaces.fixes compatibility issues between different editors