Re:Tabs or spaces – Parsing a 1B files among 14 programming ...
by gepoch on Wednesday August 31, 2016 @08:16AM
(#12397682)
Unless you're using golang,in which case gofmt will correct you. Hence the overwhelming consensus of the go row for tabs.
[ Parent
| on HN ]
Re:Tabs or spaces – Parsing a 1B files among 14 programming ...
by kgwxd on Wednesday August 31, 2016 @08:22AM
(#12397717)
Go's adoption rate would be quadrupled if they had chosen spaces instead of tabs. It's a fact.
Re:Tabs or spaces – Parsing a 1B files among 14 programming ...
by lbn on Wednesday August 31, 2016 @10:18AM
(#12398461)
Fact? My team is using Atom, VS code, IntelliJ and vim-go for Go. There has never been a problem with tabs vs spaces. On save gofmt converts all spaces to tabs and when I open Go files in vim-go it converts them to spaces according to my settings. Same for all other editors, whether you like tabs or 7-space indent.
Re:Tabs or spaces – Parsing a 1B files among 14 programming ...
by miloshadzic on Wednesday August 31, 2016 @10:25AM
(#12398513)
Pretty sure it was a joke...
Re:Tabs or spaces – Parsing a 1B files among 14 programming ...
by lbn on Wednesday August 31, 2016 @10:28AM
(#12398535)
Right. After reading so much Go hate I'm not sure who is serious anymore.
Re:Tabs or spaces – Parsing a 1B files among 14 programming ...
by zzalpha on Wednesday August 31, 2016 @09:59PM
(#12402721)
Poe's Law strikes again...
Re:Tabs or spaces – Parsing a 1B files among 14 programming ...
by akerro on Wednesday August 31, 2016 @08:22AM
(#12397720)
or python, or rust.
Re:Tabs or spaces – Parsing a 1B files among 14 programming ...
by pluma on Wednesday August 31, 2016 @08:41AM
(#12397832)
Python doesn't care either way as long as indentation is consistent (though there's a common misunderstanding that Python cares). However PEP-8 specifies that code should be indented using 4 spaces and editors should be configured to render tabs as 8 spaces (likely to make mixed tabs & spaces really obvious). But PEP-8 also specifies that code should follow whatever is the coding standard in a given project.
IOW, Python is actually far more pragmatic than most people (including most Python programmers) think. It just has a culture that strongly advocates following the rules (i.e. PEP-8 and PEP-20).
Re:Tabs or spaces – Parsing a 1B files among 14 programming ...
by deniska on Wednesday August 31, 2016 @09:53AM
(#12398273)
Python treats a tab character as the amount of spaces needed to go into the nearest multiple of 8 column. With py2 ability to mix different indentation as far as it amounts to the same column, you can format your code in pretty interesting ways.
Re:Tabs or spaces – Parsing a 1B files among 14 programming ...
by yxhuvud on Wednesday August 31, 2016 @09:56AM
(#12398297)
Well, python most certainly do care in the case when tabs and spaces are used inconsistently. In python2 you could even redefine tab width inline like https://gist.github.com/yxhuvud/2006599 .