4 ms·
Unless you're using golang,in which case gofmt will correct you. Hence the overwhelming consensus of the go row for tabs.
by gepoch 10y ago
Unless you're using golang,in which case gofmt will correct you. Hence the overwhelming consensus of the go row for tabs.
- kgwxd 10y agoGo's adoption rate would be quadrupled if they had chosen spaces instead of tabs. It's a fact.
- lbn 10y agoFact? 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.
- miloshadzic 10y agoPretty sure it was a joke...
- akerro 10y agoor python, or rust.
- pluma 10y agoPython 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).
- deniska 10y agoPython 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.
- yxhuvud 10y agoWell, 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 https://gist.github.com/yxhuvud/2006599 .
- rdtsc 10y agoUsing Python for 10+ years, never used tabs.