Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

But why that pro-space bias? I've always preferred tabs.


Because different editors handle them wildly differently but spaces are totally unambiguous.

With spaces there's no sudden, 'woah, what happened there'.


Because there are times when you need to indent to something that isn't a main indentation point, like this:

    some_function_with_too_many_args(some_argument, another,
                                     a_third, and_so_on);
That style is problematic with tabs. The only way to make that look right with all different tab settings (8, 4, 2, etc) is to mix tabs and spaces--indent to the main indentation level with tabs and then use spaces to indent the rest of the way. Not many editors do that automatically for you and so it is not a popular style.

All spaces is much easier to deal with (at the cost of being non-customizable) and so that seems to be the dominant way of doing things nowadays.




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: