5 ms·
400,000 GitHub repositories,1B files,14 terabytes of code:Spaces or Tabs?
- collyw 10y agoCan't believe there are no comments already. (Spaces by the way).
- Rockslide 10y agoI just don't get it. No one would argue that there clearly are different preferences in terms of the preferred indention width among different developers. So who on earth thinks: hey, I like an indention of 2 spaces. Let's just require that for every person on earth who will ever have to deal with my source code. Just indent with tabs and everyone is happy. Furthermore, when people are asked why they prefer spaces, the answer very often is along the lines of "because then my code looks the same on every machine and no matter where I look at it". Which, in my opinion, is totally misguided. Indenting code is not about looking the same to everyone everywhere, it's about gaining the best readability for everyone, and there just can't be a sane default for that intrinsically.
- collyw 10y agoI remember getting a course years ago. and they said that scientific studies "with guys with clipboards" as they put it found that 6 spaces was the optimal width for readability. Not that I have ever seen anyone use that.
- speps 10y agoI've always loved the intention behind `gofmt`, you can see the result here.
- ericfrederich 10y agoThey mention that they searched for Python but it isn't represented in the charts.
- greenyoda 10y agoPrevious discussion: https://news.ycombinator.com/item?id=12397246 https://news.ycombinator.com/item?id=12397246