Earlier quoted context omitted.
Provided everyone use the same tab width :)
Nope, works regardless of tabwidth; that's the point. Tabs for indent (these change size with tabwidth), spaces for alignment (these don't change so things stay aligned).
Gofmt No Longer Allows Spaces. Tabs Only
51–57 of 57 posts
Re: Gofmt No Longer Allows Spaces. Tabs Only
#52I prefer tabs (tab-size: 4), but I prefer even more if everyone follows the same conventions. Dart, for example, uses 2 spaces. When I write Dart code, I use 2 spaces. And that's the end of that. As history has shown, there is absolutely no point in discussing this. There is no clear winner.
Re: Gofmt No Longer Allows Spaces. Tabs Only
#53I'm personally in the spaces camp but my favorite point in favor of tabs no one has mentioned is all of the bytes you're saving. In a large codebase you can save kilobytes to megabytes by switching from spaces to tabs. :)
Re: Gofmt No Longer Allows Spaces. Tabs Only
#54Who actually uses tabs instead of spaces? I'm genuinely curious--one of the first things pretty much any project I've ever been involved in has been the setting of tabs characters to become spaces, simply because all text editors are retarded in this regard. This is quite strange.
Unsure if trolling or not. It's quite easy to have your editor represent a tab character as "n spaces" - where n is the number of spaces you find pleasing. In fact, I can't recall a serious editor where this isn't the case. What issues have you seen with regards to using tabs?
How does a team adopt a standard regarding line length if their code base uses tabs and the team members specify different tab widths in their editors?
In my experience, devs that prefer tabs over spaces have a tendency to be unconcerned about line lengths, and their lines of code can become annoyingly long.
For example, the most popular Go project at GitHub[1] is Docker. Docker's code base contains Go files with lines of code that are hundreds of columns wide.[2] Gross. ;-)
[1] https://github.com/search?l=Go&q=stars%3A%3E0&type=Repositor...
[2] https://github.com/dotcloud/docker/blob/master/api/client/co...
Re: Gofmt No Longer Allows Spaces. Tabs Only
#55Who actually uses tabs instead of spaces? I'm genuinely curious--one of the first things pretty much any project I've ever been involved in has been the setting of tabs characters to become spaces, simply because all text editors are retarded in this regard. This is quite strange.
Re: Gofmt No Longer Allows Spaces. Tabs Only
#56Earlier quoted context omitted.
I'd say it's newsworthy to large Go shops that use spaces with gofmt and now have to change indentation in their repos. This isn't insignificant. Also it requires additional flags for things like blame/diff to ignore whitespace changes.
no such large go shops exist.
Re: Gofmt No Longer Allows Spaces. Tabs Only
#57I'm personally in the spaces camp but my favorite point in favor of tabs no one has mentioned is all of the bytes you're saving. In a large codebase you can save kilobytes to megabytes by switching from spaces to tabs. :)
Yes, I see the smiley, but I thought it would be fun to measure this effect anyway. I whipped up a small Python script to measure the potential savings, and ran it across the 450kLOC GlusterFS codebase. It reported 3.4MB of savings (both realized and potential because our code isn't as consistent as it could be). I'm generally in the spaces camp myself, and believe that 3.4MB just isn't worth worrying about any more…