31
u/HuckBricksAtAmazon Apr 29 '20
I can't code and get it. You've gone mainstream boys and Julie.
35
u/TheJenkinsComic Apr 29 '20
I want to live in a world where comics about interpreters differentiating between tabs and spaces are 'mainstream'
9
13
u/VulpeculaVincere Apr 29 '20
You don’t really get it unless you’ve picked a side.
And if you picked a side, then It’s important that you know, whatever side it is, it’s wrong.
456
Apr 29 '20
Knock knock! Who's there?
<Vertical Tab>91
12
5
69
Apr 29 '20
What's really under Vincent Adultman's coat!
26
u/GimmeUrDownvote Apr 29 '20
Just a regular tab, putting drinks on his tab after a hard days work at the tab business factory.
6
10
585
Apr 29 '20
319
u/ten3roberts Apr 29 '20
8 steps at a time, that got me
0
Apr 29 '20
[deleted]
→ More replies (3)81
u/ubekame Apr 29 '20
I use 8.. and I think that 2 is crazy, way too little! 4 is passable, but I prefer 8.
But with tabs we can all be happy, you can use 2 or 4 and I can use 8 or 64, and everything will just work. With space just one of us would be happy, maybe.
→ More replies (16)82
u/SurplusOfOpinions Apr 29 '20
How can you do 8? You need like an ultra mega widescreen monitor.
→ More replies (13)136
u/JDaxe Apr 29 '20
Ok Wtf, she actually presses the space bar 8 times every time she wants to indent?
Also she literally says she uses Vim so she could just use
set expandtabI think we can agree that regardless of whether you have a preference for spaces or tabs she's wrong to actually press the space bar 8 times
Yes I realise it's just a TV show but even though I prefer spaces I gotta agree with Richard here
83
u/heyf00L Apr 29 '20
She'd heard he hated spaces so was intentionally hitting space to see how he'd react.
That's my headcanon.
45
u/MattTheGr8 Apr 29 '20
Pretty sure the real reason is that it’s a TV show and there would be no good way to visually depict using spaces other than actually hitting the space bar. Even shows like Silicon Valley that are pitched at a nerdier crowd have to be written in such a way that the dialogue/jokes work for less technically minded people.
→ More replies (2)35
15
u/chalk_in_boots Apr 29 '20
Maybe she found out that by hitting space 8 times she doesn't have to jack off every guy in the room.
→ More replies (2)4
u/HawkinsT Apr 29 '20
Although he said he cares about efficiency since he runs a compression company... and yet he uses emacs.
→ More replies (1)204
u/ianff Apr 29 '20
I hate this so much. I am a space person, and none of us actually hit the space bar multiple times like this. It completely misses the point of the argument.
133
u/grrfunkel Apr 29 '20 edited Apr 29 '20
I'm a space person too just by convention and most modern IDEs and text editors convert tabs to spaces out if the box. It's a funny joke though and it doesn't work unless she hits the space bar 8 times, he has to have something to complain about. The rest of the argument is completely valid (i.e. spaces are portable, tabs aren't necessarily)
The real problem is that she's using eight spaces instead of four, like some kind of psychopath
70
u/junkmeister9 Apr 29 '20 edited Apr 29 '20
Eight spaces (for spaces or tab-width) is historical and common in Unix programming. For example, the Linux kernel style guide requires tabs, and requires that they be viewed at 8 character-width. This is to make sure that the code is readable, with clearly delineated code blocks, and that coders don't go too far to the right of the screen by over-nesting.
Now, some people will claim that having 8-character indentations makes the code move too far to the right, and makes it hard to read on a 80-character terminal screen. The answer to that is that if you need more than 3 levels of indentation, you’re screwed anyway, and should fix your program.
https://www.kernel.org/doc/html/v4.10/process/coding-style.html#indentation
edit: reading comprehension. Do you have it?
→ More replies (25)→ More replies (3)42
u/plopzer Apr 29 '20
Spaces is forcing your indentation width on others, tabs are allowing the user to configure their indentation width.
→ More replies (14)5
u/FrayDabson Apr 29 '20
The way I saw it is she is doing that to trigger him purposely to see if he is as actually as bad as his friends say he is. Not that she actually smashes the space bar. It is a bit dramatized though.
8
u/lordv255 Apr 29 '20
As a beginner what do you mean by being a space person but not hitting the space bar multiple times. How else do you do it?
18
Apr 29 '20
Most if not all modern code editors and IDEs have a setting which makes it so when you press the tab key or auto indent, it inserts a configurable amount of spaces (usually 2, 4, or 8).
→ More replies (1)→ More replies (10)20
Apr 29 '20
I became a tab person the moment I heard it is better for people with visual disabilities to use.
Though most text editors can convert back and forth, you can still run into situations where that might not be the case
8
19
u/heyf00L Apr 29 '20 edited Apr 29 '20
Yeah, people say "spaces for consistency". Exactly, we don't want consistency. I want it to look one way, and someone else another. Just use tabs so we can set our preferences.
→ More replies (1)54
u/MrAcurite Apr 29 '20
As somebody with a tendency to hold grudges and die on weird hills, I'm kinda on Richard's side on this one.
→ More replies (1)86
u/gschoppe Apr 29 '20
You should be. Soft-tabs (aka spaces) are used by companies and people who want control over how code appears on each programmer's machine, without regard for what appearance is best for that particular programmer.
Some people need deeper indentation to quickly scan code, while others may need shorter line lengths to display more on narrow screens. In some cases, this may even be an accessibility issue, for people with diminished eyesight or TBI.
We've spent the last decade trying to drill it into developers heads that their programs need to be device agnostic and work across different display types and accessibility systems, but somehow we don't give code the same treatment.
I love my job, but enforced 80 character line lengths and fixed-width soft-tabs are holdovers from a defunct era.
13
u/MoffKalast Apr 29 '20
80 character line lengths
AAAAHHHHHHH oh god please no god no
→ More replies (2)→ More replies (14)14
u/xwre Apr 29 '20
I don't care if you use spaces or tabs, but you should check what is used in a file before you blindly add tabs or spaces to a file uses spaces/tabs. If the majority of your workgroup is using one method, then match them and stop creating chaos.
→ More replies (2)7
→ More replies (12)4
u/dark_mode_everything Apr 29 '20
She made some valid points while he made some pretty dumb points. Source file size? Seriously? Also, don't most editors give you the option of converting a tab press to 4 spaces?
514
u/SkyFlyer9237 Apr 29 '20
Tab Gang rise
→ More replies (58)152
u/Bibo193896423 Apr 29 '20
YAML gang has entered the chat
60
Apr 29 '20
YAML on the surface may seem like a shitty language, but there are terrifying depths of shit beneath it.
→ More replies (3)14
94
25
u/regendo Apr 29 '20
Ugh I just set up my first github action workflow yesterday and was annoyed that github generated the file with spaces instead of tabs. Naturally I replaced those and the thing broke completely.
→ More replies (1)3
215
Apr 29 '20
Joke's on you my tab produces two spaces.
187
u/GDavid04 Apr 29 '20
The real joke here is that you didn't reconfigure your ide to indent with tabs and a tab to be 4 spaces long.
91
Apr 29 '20
I like 2 spaces for languages like HTML or JS that tend to be crazy-indented.
→ More replies (9)66
u/solarshado Apr 29 '20
A while back I dug out some old code of mine and it was indented with one(!) space. I duno what teenage-me was thinking...
→ More replies (42)→ More replies (10)8
Apr 29 '20
Look, I'm just doing what my employer's code style says to do. Personally I couldn't care less about this issue.
4
u/crack3rtastic Apr 29 '20
Back in the day when I was self-learning web development (we are talking PHP4 days) I was never exposed to the tabs vs. spaces war. Having seen it, I still shudder thinking back to how I had my editor set up for hard tabs going out 5 spaces.
→ More replies (2)3
15
21
85
u/vaarux Apr 29 '20
Space gang is just repeating yourself and the first rule of coding is to never repeat yourself. Take that space gang
18
Apr 29 '20
What if I make my tabs one space
→ More replies (1)10
u/the9trances Apr 29 '20
Spaces users can get what they want from tab-formatted code; tab users cannot get what they want from space-formatted code
→ More replies (2)10
u/MoffKalast Apr 29 '20
Space gang leaves less space on disk due to all the spaces.
→ More replies (1)4
9
9
u/Preme_Dave Apr 29 '20
Does any one have a practical reason to use 4 spaces instead of tab? I mean we build yaml files and use single spaces to indent (I was told that was standard)
12
Apr 29 '20
One reason trumps all other arguments: Spaces have unambiguous width.
You never have to deal with the alignment getting thrown off (or way over-expanded) because you happen to view the code with a tool other than your specially-configured editor of choice. Most command line tools like “diff” or “less” will expand tabs to 8 spaces by default, and many give you no control over tab width at all.
All those indentation problems disappear the moment you stop using tabs.
It’s neat that tabs are a single character, but the storage space savings are inconsequential, and all IDEs are smart enough to deal with indent/unindent of multiple spaces in a single keystroke.
→ More replies (8)6
Apr 29 '20
There's someone in this thread who said they mostly work in the terminal and pasting code results in spaces, so it's easier to use that than convert everything. Which is very niche and likely fixable (though the fix might be more effort than just using spaces anyway). But other than that, no. The "code looks the same everywhere" thing is total BS. Code doesn't have to look the same everywhere. Indent length is developer preference and, more importantly, an accessibility issue.
0
Apr 29 '20
[deleted]
3
u/Keavon Apr 29 '20
Regarding your edit, nobody (besides the writers on Silicon Valley, for exaggerated comedic effect) is claiming a downside of spaces is the need to tap the space bar four times during normal coding. But you often do need to tap space several times to fix space misalignment if there's an alignment mistake caused by selecting code or copying and pasting from the internet. In most editors you also have to tap the backspace key four times. And clicking at the start of a line requires extra care to select to the right of the last whitespace character which is a much smaller target if that's a space character instead of a tab character; failing this leads to mistakes. I often see people misaligning their code because they have one extra or one fewer space, and it's hard to notice those mistakes and some people don't care enough to fix them. The point of indenting is to indent in integer increments. Fractional indentation can only exist to cause mistakes. There's a specific ASCII character designed to indent in integer increments, and there's even a big, dedicated key on the keyboard to insert that exact character.
8
7
u/ValuablePromise0 Apr 29 '20
I wonder if the reason there are two arrows is because "shift-tab" would go backwards. Also, I think you got the arrows backwards (at least for me, the left-pointing one is on top).
2
Apr 29 '20
I'd test this excellent theory for you but I don't have the necessary equipment, I replaced my Tab key with a New Coke key.
7
4
u/nissenice Apr 29 '20
The arrows on the tab symbol are in the wrong order. The left arrow should be above the right arrow.
4
4
u/mhaberling May 10 '20
Semicolons are so confusing, let’s just replace them with invisible characters that will be easier
12
u/MechanizedProduction Apr 29 '20
I use hard tabs in all my code, AMA
8
5
u/Keavon Apr 29 '20
What does it feel like being an enlightened, highly-rational human being?
4
u/MechanizedProduction Apr 29 '20
Well, I only have to hit the left key once to reach the next highest level of indentation. So pretty easy.
9
13
u/Minteck Apr 29 '20
Fun, but that's the fault of my IDE, it replaces tabs with 4 spaces...
23
u/Commander-PopNFresh Apr 29 '20
I bet there are tab zealots who don't even realize they're using spaces because their IDEs handle it properly.
8
→ More replies (9)4
22
3
3
Apr 29 '20
I had a senior dev who loved to screw with one of his colleagues and would always do do shit like use some odd number of spaces (3,5,7,etc) in place of tab. He had a hidden teams group where we would take bets on how long it took the other guy to find it.
4
u/Rafael20002000 Apr 29 '20
I wrote a programm to replace all tabs at start of a line with random spaces
→ More replies (8)
3
3
3
u/Y1ff Apr 29 '20
The actual reason tabs are better is because one can customize the width of a tab, but not the width of multiple spaces.
3
3
u/__i_forgot_my_name__ Apr 30 '20
You shouldn't really every need to insert indents (tab or space) manually (unless you're using Python), most languages can be indented by just opening a block with a newline, and then subsequently you can use an on-save hook to make your formatter can clean up the rest.
This is mainly why people get annoyed by indentation based languages, it makes automatic formatting harder, and deep indents unmaintainable as a result, which is why the Python programming guideline is so strict about indent-depth.
2
Apr 29 '20
Long live the debate! Guess how many spaces?
2
u/for_shitposting Apr 29 '20
Is it crazy not being committed to one or the other, but instead using whichever whitespace character is encouraged by a specific language? Ie: PEP8 encouraging 4 spaces. As long as the two aren't being mixed or anything blasphemous like that.
6
2
2
2
2
u/Communism_of_Dave Apr 29 '20
This, I had a professor a year or two ago who at the beginning of the semester took points off if you used tab instead of four space. Needless to say the Comp Sci department received a lot of reports for her and suddenly we got points back a few weeks into the semester.
2
2
2
u/Abdlbsz Apr 29 '20
It only costed me 1500 bucks and a failed college class to understand this joke.
→ More replies (2)
2
2
2
2
u/Sigg3net Apr 29 '20
I'm a tab guy myself. However, four spaces is the recommendation for python. Luckily, I can use tab and have the editor convert them to spaces.
It's like solving world issues.
2
u/delinka Apr 29 '20
Python must have written this. No other language cares about intermixing indentation.
2
2
u/__pah__ Apr 29 '20
Tabs is preferred as you can set your editor/IDE to display with X many spaces, to each their own. Great for those with vision impairment and like 8 space indentation for example.
2
2
Apr 30 '20
So much easier to just use all spaces. Set your editor to insert 4 spaces when you press tab and you can literally never have to think about it again
2
May 01 '20
Since we're all talking about characters...
بٍٍٍٍََُُُِّّّْرٍٍٍٍََُُِِّّّْآٍٍٍَُّ🇮🇹 بٍٍٍٍََُُُِّّّْرٍٍٍٍََُُِِّّّْآٍٍٍَُّ🇮🇹
8
u/BossOfTheGame Apr 29 '20
You don't really want to hang out in places like that anyway. Its an inconsistent experience depending on the manager. The space gang will always deliver on expectations.
4
3
3
3
3
3
4
3
u/Vok250 Apr 29 '20
Man, these indentation errors are annoying. Too bad there's no way to wrap a block of code in a special character or something so that whitespace doesn't matter!
2
2
2
2
2
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
u/Scarface4024 Apr 29 '20
This is the first programmer humor meme that I (a common person) could actually understand. Very funny!
1
1
1
Apr 29 '20 edited Apr 29 '20
Every tab in the club changes height depending on where they stand, that's how they detected the spaces.
1
1
1
1
u/gordonv Apr 29 '20
There's an HBO series named Silicon Valley (3 Seasons, incomplete, not in production anymore) that used this joke, as long as many other computer programming jokes. The series is actually quite entertaining and insightful.
1
1
1
1
1
1
1
1
1
1
1
u/itsjibblesnbitz Apr 29 '20
Why would you press something four times when you can press something once?
1
1
1
1
1
1
1
1
1
1
1
1
1
u/Bongcloudforthewin Apr 29 '20
I always recognize your comics because of the unique style. This is so relatable.
1
1
1
u/Xerxesthegreat1 Apr 29 '20 edited Apr 29 '20
Hi, Bill here, would I be allowed in? if anybody trips and falls I could always, .... pick up the tab.😉
1
1
1
1
1
1
1
u/chhuang Apr 29 '20
All you people that doesn't convert tabs to spaces never programmed x86 assembly
1
1
u/ivebeencalledpeppery Apr 30 '20
Goddamnit, every time! And I know for a fact there are four spaces there Sublime, you asshole!!
1
1
1.0k
u/theGreatWhite_Moon Apr 29 '20
on my what? ON - MY - WHAT?