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

JavaScript has commonly used 2 spaces for years before "StandardJS" (which is now out-of-date because certain es7 features necessitate line-terminating semicolons, but I digress).

CoffeeScript was a big catalyst, and I think Rails was as well, but it probably would have happened anyway. Of the languages I use regularly, the only ones for which 2 spaces is not accepted as normal are Python (which uses 4, probably because it was set in stone decades ago, before people even knew how to write code) and Go (whose auto-format uses tab characters, probably because Rob Pike is a stubborn prick).

Really, 4 spaces is an awful lot, unless your eyesight is failing.



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

Search: