Re:Tabs or Spaces? The Top Starred Repositories in GitHub An...
by untog on Saturday December 26, 2015 @07:31PM
(#10795857)
It'll be an interesting experiment to see if there are any problems with that approach. If not, maybe we can all finally move on.
[ Parent
| on HN ]
Re:Tabs or Spaces? The Top Starred Repositories in GitHub An...
by brandonbloom on Saturday December 26, 2015 @07:52PM
(#10795932)
Notably, Go makes a few other decisions that help with this approach:
1) `go fmt` fixes up whitespace, and is fast enough to run on every file-save. Although this sometimes screws up my undo stack.
2) Spaces are still used for alignment, but...
3) Only tabs are used before the content of a line, and...
4) Only spaces are used throughout the content of a line.
The primary reason that I prefer spaces is that it means that I don't have to constantly look at hidden characters while editing. However, go fix's enforcement of the begin/intra-line separation of tabs and spaces alleviates that problem: If it's touching the left margin, it's a tab, otherwise, it's a space.
Re:Tabs or Spaces? The Top Starred Repositories in GitHub An...
by to3m on Saturday December 26, 2015 @08:04PM
(#10795962)
Doesn't work with comments that float to the right of the code (such as the ones you get with M-; in emacs). Along these lines:
fred /* Fred */
fred(fred) { /* Fred */
fred /* Fred */
} fred {
fred /* Fred */
}
(The reader must make up their own mind about whether this is important or not.)