3 ms·
What's the reason for recommending 2 space indents ? I find it easier to read with 4 or even more spaces indent.
by cocoflunchy 15y ago
What's the reason for recommending 2 space indents ?
I find it easier to read with 4 or even more spaces indent.
- elliottcarlson 15y agoI was wondering the same thing. Recently, a coworker and myself were debating the use of tabs vs. spaces - and while I know this is a battle that has been going on for a while and won't end any time soon - one of my points against spaces was due to readability. 2 space soft-tabs seems much harder to follow - while using hard tabs for indentation, you are able to adjust your editor to visually work out what suits you best (2 spaces, 4 spaces or even 8 spaces).
- caw 15y agoMy coworker does some funky blend of spaces and tabs. His tab key inserts 4 spaces, but if he tabs twice (8 characters), it becomes the tab character. He says it works better when printing. I can't for the life of me figure out how to replicate the effect in vim to be able to read his files logically, and he can't tell me because he's an emacs user.
- obtu 15y agoSomething like: set ts=8 sw=4 et sta (tabstops to 8 (the default), shift width to 4, expand tabs, smart tabs)
- petercooper 15y agoIt's the least amount that's least like to be accidental while still visually significant. The emphasis on the least amount is to maintain good line lengths, which can be an issue with the way many Rubyists namespace their code or pull off method chains.
- gioele 15y agoI wonder what is the problem with hard-tabs. I enjoy 8-space indents, fellow programmers prefer 4-space indents, some others 2-space indents. With hard-tabs each of us is able to use their preferred settings without messing with the commits (setting the tab-to-space ratio in text editor).