2 Spaces or 1 Tab, what's the standard for indentation in the Rails Community?

Lance Pollard picture Lance Pollard · Apr 20, 2010 · Viewed 27.6k times · Source

I've noticed that most of the HTML/XML/HAML that gets generated from plugins uses 2 spaces instead of 1 tab. I use textmate and have tabs set to 4 spaces for HAML/HTML/XML and 2 spaces for Javascript/Ruby, but I only have to press the tab key once to get nice indentation. Pressing the space bar twice and delete twice seems like too much work :p.

Do you manually type two spaces, or is some middle layer converting tabs to two spaces? Or do just a few of you use tabs?

Answer

Ben picture Ben · Apr 20, 2010

2 spaces is generally agreed-upon.