|
|
|
|
|
by dilap
3827 days ago
|
|
Nah, it works almost everywhere (ignoring things like nim or make that treat them differently); it's not just a Go thing. Here's a random page I found advocating the style for js and css: http://lea.verou.me/2012/01/why-tabs-are-clearly-superior/
And here's what codinghorror had to say about the style:> This way, in theory at least, the level of indent can be adjusted dynamically without destroying alignment. But I'm more inclined to think of it as combining all the complexity and pitfalls of both approaches, myself. Which sadly seems to be most people's reaction -- basically, it might be better, but I'll be damned if I'm going to have BOTH tabs and spaces in my files! Oh well... Spaces are obviously a workable solution, but there are two really big downsides: (1) it throws away information -- when should I insert or remove a indentation block of spaces? You can make your editor guess, but it won't always guess right, and you won't always be editing inside your properly configured editor. A tab simply says what it means and requires no editor trickiness. (2) The obvious inability to adjust the visual width of the indentation, though personally as long as it's not too crazy I'm happy with anything from 2-8, so this doesn't bother me. (I normally run with tabs at 4.) |
|
Go is making a play to make tab/space mixing work nicely in practice and that's quite interesting to watch.