📊 I'm sorry: Tabs vs. Spaces

Do you indent your code using tabs or spaces?

  • Tabs

  • Spaces


Results are only viewable after voting.

Adam

Mr. Webwide
Administrator
Local time
18:59
Joined
Sep 24, 2019
Messages
1,246
Pronouns
he/him

I hope we can all agree that it doesn't really matter as long as you are consistent within projects... which is why this thread is filed under forum games. There is no right answer.

Having said that, I'm very curious to see where our community sits on the matter! There is a poll up there. 👆

You're welcome to state why you opted for your preference below but to suggest the opposing view is wrong on this won't be happening in my thread. 😉

To clarify:

  • Using the 'tab' key to insert spaces via an editor preference still counts as using spaces.
  • This is for projects where you are in control, not where you are forced by other coding standards.
Voting is anonymous.

Have fun!

 
Last edited:

AndrewDavidJ

Member
Local time
13:59
Joined
Oct 7, 2019
Messages
21
Pronouns
He/Him

Tabs as spaces and never something else. Spaces are consistent and will display the same over all editors, websites, machines and so on.

Yeah, but it's really bad for accessibility if you're working with other developers. The IDE allows you to set the width of a tab without it affecting the actual file itself, while a space is always a fixed width. So for the vision impaired who have to increase the font size, the indentation before the lines will all be very close to each other, which defeats the entire purpose of making your code clearer to read by indenting.

So, for me: Tabs over spaces.

 

VickiLanger

Asks "why?" too much
Gold Member
Local time
13:59
Joined
Oct 7, 2019
Messages
189
Pronouns
she/her

I don’t really have my own opinion on it, but python docs say to use spaces. So, I use tab as spaces.

 

Gummibeer

Astroneer
Moderator
Local time
19:59
Joined
Oct 5, 2019
Messages
1,153
Pronouns
he/him

spaces - here you go. 😅

 
Top