News for hackers. Stuff that matters.
Re:How to Deploy Software by blowski on Tuesday March 01, 2016 @02:34PM (#11205408)
> Deploying major new features to production should be as easy as starting a flamewar on Hacker News about spaces versus tabs

Great writing. Spaces all the way.

Re:How to Deploy Software by Bognar on Tuesday March 01, 2016 @03:55PM (#11205974)
Elastic tabstops are clearly the best, but until we have good editor support I'm sticking with spaces.

http://nickgravgaard.com/elastic-tabstops/

Re:How to Deploy Software by csn on Wednesday March 02, 2016 @01:14AM (#11208379)
For now, these decisions will be made for me by our gofmt overlords.
Re:How to Deploy Software by impostervt on Tuesday March 01, 2016 @03:44PM (#11205891)
Seriously? Ugh. Tabs FTW.
Re:How to Deploy Software by BinaryIdiot on Tuesday March 01, 2016 @04:14PM (#11206104)
I've actually thought about this a lot (for some reason).

Spaces are fixed. Tabs are adjustable via most user interfaces.

So, in theory, you'd think tabs are superior because everyone can have their own amount of spacing and that's that.

Therefore tabs > spaces

(I should probably leave now)

Re:How to Deploy Software by HeyImAlex on Tuesday March 01, 2016 @11:13PM (#11208050)
Until you want to align code on non-tab boundaries.
Re:How to Deploy Software by BinaryIdiot on Wednesday March 02, 2016 @10:43AM (#11210604)
True...damn it.
Re:How to Deploy Software by gauravagarwalr on Tuesday March 01, 2016 @04:49PM (#11206369)
But guys, this is what is being proved. Stop. Don't. Come back.
Re:How to Deploy Software by felixmc on Tuesday March 01, 2016 @04:06PM (#11206056)
Would someone mind explaining the argument for spaces over tabs? Possibly naive young dev here.
Re:How to Deploy Software by ktRolster on Tuesday March 01, 2016 @04:23PM (#11206178)
How many spaces do you like to indent your code? Some people like 3 space indentations, some like 8 spaces, and some like 5. It's very personal (but anyone who doesn't use 3 is a reeky brazen-faced mammet).

A simple solution is to use tabs, because then every developer can set the tab distance however they like, and they are happy. It breaks down when you have code that is aligned beyond the indent, like this:

  if(a && b &&
     c && d &&
     e && f   ) {
In that case, increasing (or decreasing) the tab distance will ruin the intention.

The best solution is to use tabs to the point of indentation, and then spaces thereafter, but a lot of code editors don't support that, so in practice it's hard to implement, so people use spaces to preserve their formatting when it gets uploaded to github.

Re:How to Deploy Software by collyw on Wednesday March 02, 2016 @01:17PM (#11211801)
Mixing sounds like the worst option.Its what has cause horrendous looking code in the past when you open someone elses code and they are mixed.

Python and spaces for me.

Re:How to Deploy Software by ktRolster on Thursday March 03, 2016 @09:41PM (#11221708)

  > Python and spaces for me.
Sounds like you are a very open-minded individual. Not.
Re:How to Deploy Software by collyw on Monday March 07, 2016 @01:36PM (#11240576)
I say this from experience, not narrow mindedness.

Open a file where it is all spaces, and it looks the same on every machine. Open a file with a mix of spaces and tabs, and it often turns out an absolute mess.

Re:How to Deploy Software by pcora on Tuesday March 01, 2016 @08:17PM (#11207512)
OMG! 3 spaces? EVEN number? 2 or 4. Never even.
Re:How to Deploy Software by ktRolster on Wednesday March 02, 2016 @12:05AM (#11208191)
You sir, are a reeky, brazen faced mammet!
Re:How to Deploy Software by xorcist on Tuesday March 01, 2016 @05:01PM (#11206463)
Short version: spaces doesn't break over time.

Longer version: First understand that there is no tabs vs. space. There is only tabs + spaces vs. only spaces. (Because not all indentation line up with tab spaces, and someone may wish to line up assignments, lists, etc.) Only one developer in the history of your project that uses another tab stop standard is then enough to mess up your indentation. And that's just one way to mess it up, in a sufficiently large project some creative developer will find another.

Spaces just work and ensures your guidelines are followed. The only downside is a few wasted bytes. It might have been a religious debate in a long distant past when someone actually counted bytes, but today it's mostly young developers who don't know better who engage in it (with a few exceptions). Linus uses spaces. OpenSSL changed to spaces as part of cleaning up their codebase. It's the default behaviour of GNU indent. It is a good idea.

Re:How to Deploy Software by cortesoft on Tuesday March 01, 2016 @07:30PM (#11207334)
Right, but how many spaces?
Re:How to Deploy Software by collyw on Wednesday March 02, 2016 @01:26PM (#11211858)
4
Re:How to Deploy Software by slavik81 on Tuesday March 01, 2016 @05:27PM (#11206631)
Spaces always have the same width, so it's harder to screw up formatting and easier to enforce stuff like maximum line width.

Tabs width can be set to whatever you want, so everyone can use the spacing they prefer.

Re:How to Deploy Software by sdegutis on Tuesday March 01, 2016 @04:09PM (#11206073)
Spaces work better with my preferred IDE setup. Therefore spaces are inherently and objectively superior to tabs.
Re:How to Deploy Software by andrezsanchez on Tuesday March 01, 2016 @04:23PM (#11206176)
I personally like the idea of tabs better, but prefer spaces because it makes navigating the text less awkward when traversing tabs. It may sound stupid, but for my own stuff it's just more comfortable.
Re:How to Deploy Software by atonse on Tuesday March 01, 2016 @02:47PM (#11205511)
I take umbrage!!! (oh wait, I am a spaces person too)
Re:How to Deploy Software by mwpmaybe on Tuesday March 01, 2016 @02:39PM (#11205451)
Ah, but how many?
Re:How to Deploy Software by icpmacdo on Tuesday March 01, 2016 @02:49PM (#11205521)
I like a mix of space's and tab's depending on if my line number is divisible by 3 or not.
Re:How to Deploy Software by blowski on Tuesday March 01, 2016 @02:50PM (#11205528)
2 1/2. Obviously you're using an editor that can do half-spaces?
Re:How to Deploy Software by dogecoinbase on Tuesday March 01, 2016 @04:18PM (#11206137)
Of course! I simply type one in with a half A-press.
Re:How to Deploy Software by walrus on Tuesday March 01, 2016 @11:06PM (#11208030)
For those who don't know the reference: https://www.youtube.com/watch?v=kpk2tdsPh0A. It's definitely in the hacker spirit.
Re:How to Deploy Software by Zikes on Tuesday March 01, 2016 @02:57PM (#11205580)
En Space: U+2002
Re:How to Deploy Software by McGlockenshire on Tuesday March 01, 2016 @02:55PM (#11205568)
Re:How to Deploy Software by insulanian on Wednesday March 02, 2016 @04:15AM (#11208893)
2 or 4
Re:How to Deploy Software by Raphmedia on Tuesday March 01, 2016 @03:48PM (#11205920)
Tabs are obliviously superior since every developper can visually resize them to be as small or as big as they wish. Personally, I can't work with small indentation. My eyes have a hard time following long straight lines.