Indentation: 2, 4 or x spaces?

2 spaces


4 spaces


other amount of spaces




124 votes Β· Closed

This preferences changes over time. Let's find out how divided we are today!

Learn Something New Everyday,
Connect With The Best Developers!

& 500k+ others use Hashnode actively.

j's photo

just play 'pick a number' with your team and define an git hook that auto-formats your code.

tabs / spaces are mostly non relevant problems in modern software development. So it's about visual structure hence it's for humans hence it's aesthetics and this to me tends to be a bike-shedding discussion.

I let my team pick, I am old I don't care anymore about such things. Consistency is more important to me.

Jos Fabre's photo

full-stack father, developer, crafter

This is by no means a serious thing. After having developed for decades with just me, I'm now part of a team and I'm curious to what others prefer

j's photo

stuff ;)

Jos Fabre fair enough. to me it's more of a statement of time. I grew up with 1 tab, I got 'corrected' to 4 spaces so it looks everywhere the same. now they like 2 spaces.

But ofc it makes perfect sense to just ask. it wasn't meant as an attack or anything.

Tapas Adhikary's photo

I have been using 4 spaces all while.

Hipkiss's photo

My tabs are set to 4 spaces in work and just tabs at home.

Want to read more?

Browse featured discussions

Β© 2020 Β·Β Hashnode