News for hackers. Stuff that matters.
Re:Show HN: Codassium - WebRTC-based video chat and code edi... by lelandbatey on Thursday April 04, 2013 @01:18PM (#5493810)
This is very awesome (I was talking with someone the day before last about how something like this should exist).

On a very different note: why is it that the default "tab" in so many of these online editors is just two spaces? It seems to be a thing in many online code based editors, and I don't know why. Is that a common convention for the languages that the authors of these in-browser-editors use? What's the deal? And why can't I change it to four spaces?

Re:Show HN: Codassium - WebRTC-based video chat and code edi... by davefp on Thursday April 04, 2013 @02:35PM (#5494398)
Two space indentation for me. That's pretty much the default for ruby code AFAIK.

I'm somewhat ambivalent about it though. On the one hand I find it easier to read (less scanning back and forth across the page) but on the other it is forgiving to deeply nested code.

Re:Show HN: Codassium - WebRTC-based video chat and code edi... by mweibel on Friday April 05, 2013 @12:51AM (#5496844)
Well, I'll be that guy then: Why are people not using tabs instead of spaces?

Really: I couldn't care less about how much spaces my team mate is using for a tab. I just know: Indent by tab, and everyone can set their settings on their own and it looks always perfectly indented.

Re:Show HN: Codassium - WebRTC-based video chat and code edi... by sgk284 on Friday April 05, 2013 @01:20AM (#5496910)
Relevant: http://www.jwz.org/doc/tabs-vs-spaces.html

tl;dr; Spaces are the correct technical choice due to interop issues with TAB.

Re:Show HN: Codassium - WebRTC-based video chat and code edi... by BHSPitMonkey on Friday April 05, 2013 @03:24PM (#5500474)
Interop issues which, in real life, never actually surface as issues for anybody.

I'm personally in the camp that feels that spaces are logically inferior; A tab uses one character to represent some atomic idea that you intend to declare (an indent level). Replicating this intent with sequences of repeated spaces is on par with centering text on a web page by using

         Hello World!
instead of setting the text-align CSS style. (Just as that method prevents the browser from centering the text correctly according to the user's chosen viewport size, so using spaces for indentation prevents an editor from letting a user read code the way they would prefer to.)

Of course, if the project/platform you're working in has an established style guide or convention in place, go with that :)

Re:Show HN: Codassium - WebRTC-based video chat and code edi... by mweibel on Monday April 08, 2013 @03:29AM (#5510406)
Exactly that is what I think as well.
Re:Show HN: Codassium - WebRTC-based video chat and code edi... by randall on Thursday April 04, 2013 @01:54PM (#5494077)
I think a lot of people use two spaces in diff communities. I prefer two, but I'm not sure if it's because I'm in these communities or what.
Re:Show HN: Codassium - WebRTC-based video chat and code edi... by drivingmenuts on Thursday April 04, 2013 @02:07PM (#5494170)
I'm a four-space tab person, myself. Two spaces looks like a typo rather than an indent, to me.

At one time there was a movement afoot for some sort flexible tabbing (using actual tabs) but it seems to have died out.

Re:Show HN: Codassium - WebRTC-based video chat and code edi... by SeanDav on Thursday April 04, 2013 @07:34PM (#5495972)
wow, you guys just don't have a clue ;P

It's 3 space tabbing or go home.

(I am actually serious, about the space part, not the clue part. 2 spaces looks like a typo and 4 wastes space once you indent a couple of times. Got to be 3, although if I had to choose, 2 or 4, then definitely 4.)

Re:Show HN: Codassium - WebRTC-based video chat and code edi... by hayksaakian on Thursday April 04, 2013 @09:47PM (#5496405)
in languages that enforce spacing 4 makes sense, but otherwise why bother with it?

larger spacing discourages pyramid code (like in python which is stylistically functional), but sometimes (eg: HTML) this is unavoidable, and 4 spaces are a nightmare