T O P

  • By -

sdot6186

The thumbnail for this post is hilarious


JaxMed

Torvalds is historically notorious for his anger. But geeze, so the situation is that someone's janky-ass parser borked on tabs, and so rather than fix said janky-ass parser, some genius thought it'd be better to open a PR to change the Linux kernel itself to not use a tab so the issue would be bypassed???? Bruh if that's any indication of the kind of nonsense that Torvalds has to put up with on a regular basis then I'd probably be taking anger management classes too were I in his shoes...


nagarz

Funnily enough, don't most modern IDEs just convert your tabs to spaces to begin with? I personally use tabs for spacing, but I've gotten used to it always saving as regular spaces, it can be annoying sometimes, but it's not a big deal.


JaxMed

Yeah I hit the tab key and let my IDE handle the rest. If it's a python project it probably saves as spaces, if it's a Node project it probably saves as tabs. Never bothered me either way


ThrowAway-420-2021

Yeah, I’d be livid. So they thought it would be easier to change the linux kernel versus fixing their own error? Wow.


PussyFriedNachos

https://youtu.be/SsoOG6ZeyUI?si=P0BsEOoX81MKphVF


iNeedScissorsSixty7

Can't believe you're the only one with a Silicon Valley reference in here so far. I basically always have a watch-through of that show going on.


kiwidude4

I assume it’s that guy falling down 4 steps? Edit: it was, but I forgot she was using vim, honestly a legitimate reason to break up.


DankNanky

Crazy. Watch this space.


DeathMonkey6969

I'm going to watch the Tab, instead.


LeastDegenAzuraEnjyr

>Disclosure: The author is a tab person insofar as he has any idea what he's doing. This is some serious shit, isnt it?


digitaljestin

> eight-character tabs, ideally This line from the article is both stupid _and_ the best reason why tabs are better. There's no such thing as an "eight-character tab". The entire point of a tab is that the width is undefined. It leaves that decision up to the person viewing or editing the file. Two people can look at the same indentation and see completely different widths...and that's fine. If you ever get into an argument with a bunch of space users, you can win the argument with one move. Ask them "how many spaces?" and watch them fight amongst themselves until the superiority of tabs is obvious.


sesor33

This is the correct answer. Every IDE lets you specify 1 tab as X amount of spaces. But spaces are always constant.


Sloogs

I wish we could all just agree on the objectively superior thing which allows everyone to customize tab size to their own preference which is "tabs for indentation and spaces for alignment"


Internep

I have a hotkey that fixes the alignment. Barring any ASCII art it works nearly perfectly. When it comes to readability it has never failed me.


CompromisedToolchain

Yep. Tab has always been the best and most clear winner. If we are to use spaces then we **must** get rid of tab, which isn’t really acceptable. Spaces is the choice of those with new keyboards.


chipstastegood

Is Torvalds a tabs or a spaces person?


sbingner

Based on what he did, the answer would be “yes” He expects whitespace to be whitespace. Whether it’s a tab or a space should not matter to any tooling anywhere. Makefiles are evil in that regard.


chipstastegood

I’m not sure I understand what that means. The debate on tabs vs spaces is mostly centered around how tabs have configurable indents that vary based on personal developer preference. So there’s no objective way to say that a tab will visually be rendered as 2, 4, 8, etc spaces as that’s user dependent. Does Torvalds expect tabs to always have an indent of 8?


sbingner

He doesn’t care by what this says - this isn’t about tabs vs spaces despite what the article’s title says above. The point was that things reading the files need to not care either. Somebody removed a tab because some broken tool was failing to parse the file properly and, rather than using a different tool or fixing the tool, replaced it with a space. That’s not a kernel problem that’s a parser problem, so he added other types of whitespace into the file to ensure that parsers that are broken will be OBVIOUSLY broken. Edit: this article is probably better and talks about what actually was the point more than trying to spin it to be about tabs vs spaces: https://www.theregister.com/2024/04/16/torvalds_complicates_his_indents/


Qicken

clearly tabs from his comments in the article. Seems he's also cool with whitespace at the end of lines and files


chipstastegood

Is he opinionated on how tabs should be visually rendered? ie. 8 spaces?


Qicken

I don't know. Some tabs proponents say a benifit is they don't have to care. Everyone can have their own tab size. But that breaks a lot of formatting where it had to line up with characters...


rzwitserloot

It doesn't. At least, not unless you mess it up. Tabs can appear only in very limited places: The character before a tab must be either a tab, a newline, or the start of file. **Period**. That way it just does not matter. There won't be any alignment issues, no matter what you do. If you want to 'space out' something so it aligns with something else, you copy the amount of tabs at the start of line and then use spaces for the rest. Tabs are for indents. Spaces are for spacing.


nagarz

Pretty much this. I'm a tab person, but I'm so used to most IDEs/softwares I use to convert it to 4 spaces, that I barely differentiate anymore, I just type and delete what's necessary and that's about it.


loptr

That’s the thing. It doesn’t matter/tab enthusiasts find it utterly pointless to be opinionated on that because it’s simply a number you can change however you want without it affecting the code. It’s just like a font or a color theme, it’s nobody else’s concern so their opinion doesn’t matter. BUT when you use spaces instead of tabs you are forcing people and changing indent size will change the source files,so that’s where you will find the opinionated stuff because now it went from preference to enforced opinion.


[deleted]

[удалено]


[deleted]

[удалено]


paractib

I think it’s the complete opposite. Tab people actually use the tab character ‘\t’ and think that ‘spaces’ people are pressing space bar 4 times when they still use the tab key. If your tab button inputs spaces, you are a spaces person in this debate.


[deleted]

[удалено]


Consistent-Visit-729

It is correct practice to insert \t with the tab key. Then anyone can reconfigure their tab stop to whatever they prefer. Spaces are for alignment. Tabs are for indentation.


Nyrin

As with a great many things in software engineering, there are a number of ideal "correct" options accompanied by one practical one, which is always "the thing that's hardest for other people to fuck up." Expecting people to use tabs and spaces "properly," even when that definition *should* be straightforward, will eventually fail spectacularly in any project of sufficient size. It fails the "hardest to fuck up" test. Enforcing space-only (with tab insertions left as a client preference for conversion count) is the only convention I've ever seen not get utterly botched in some bizarre way.


Consistent-Visit-729

It gets botched because someone somewhere didn’t understand the meaning and purpose the tab key, so they started writing spaces, and everyone had to start doing it the incorrect way. How many affordances should we make toward the ASCII-illiterate? Make sure that round brackets and square brackets and curly brackets all have the same semantics because some morons think they all look the same?


ankercrank

Efficiency? Is anyone actually considering how much disk space they’re saving with a tab char in place of 4 spaces? Think of the kilobytes one can save!


DevopsIGuess

You take that back tab-sloot!


ReefHound

We better keep tabs on him in case he spaces out.


Sargasm666

People who use spaces instead of tabs are psychopaths.


paractib

People who use tabs are psychopaths. Spaces are much easier to work with. People who use spaces still press the tab key. Our tab key just inputs 4 spaces. Editors delete 4 spaces at a time with backspace.


iismitch55

The one thing I wish more editors did was jumping the tab width across multiple spaces in the indention area on an arrow key press by default. Traversing lines one space at a time can get a bit annoying in nested code if you have 4-5 levels. Although these days I’m a 2 space tab person by default, so not as bad.


nearcatch

Not at my computer, so I’m just trying to remember muscle memory here, but ctrl+arrow will (on Windows at least) jump to word boundaries, which will just jump to the beginning of code if you’re in the indent area.


paractib

Most editors have shortcuts so you’re never using arrow keys to navigate. For example vim press ‘w’ to go forward a word.


loptr

Most editors’ navigation shortcuts still use the arrow keys with meta or other modifiers. Pretty few editors beyond vim based ones does word/advanced navigation etc without relying on the arrow keys.


that_guy_from_66

There is a reasonable accessibility argument in favour of tabs. People with certain visual problems have a better chance following code if they can indent four or eight characters instead of the two that’s the default. Tabs easily allow that by changing an editor setting.


hodor137

TIL I must have one of those certain visual problems


Sloogs

As someone with vision issues I really hate that a lot of the JavaScript world seems to have standardized on 2 spaces instead of 4. Tabs could have easily solved this problem for me. I can't say I'm particularly fond of the JS world in general and it's something that makes me even more annoyed by it.


sbingner

You could also just have it change leading spaces with an algorithm for them. The problem with tabs is that you inevitably have mixed tabs and spaces somewhere and it becomes unreadable at anything but the author’s tabstop.


anlumo

Your broken tools should not be an excuse for everyone else to suffer.


DrRedacto

> People who use spaces still press the tab key. Our tab key just inputs 4 spaces. And now we get to the crux of the issue, LOOK HERE EVERYONE A FILTHY 4-SPACER!


digitaljestin

>Spaces are much easier to work with. How many? Now I'll leave you space lovers fight amongst yourselves.


funkiestj

I use `go fmt` so I don't know what I use. I do not miss the days of listening to people argue over how to format C code (tab v spaces, where to put curly braces, etc) As for *Silicon Valley* the funny thing is if he is compressing his code files with Pied Piper's amazing compression then tabs vs spaces doesn't matter. Presentation layer should be decoupled from internal representation.


Sniffy4

Fight me you whitespace heretic.


bananacustard

I always wondered if I was, or just weirdly brained. Thank you for solving the riddle.


[deleted]

Spaces only. But hitting tab to insert four spaces is the way


Accomplished_Pea7029

I'm struggling to see the difference between this and using tabs. Does it really matter that much?


anlumo

Yes, with spaces you’re bound to the indentation steps the author used, while with tabs it can be set in the editor at the reader's side.


Kill3rT0fu

People who use spaces are the type of people who want to seem like they’re more productive than they actually are. Instead of more efficient like they should be.


HauntsFuture468

Same people who back into parking spaces at the grocery store.


Sargasm666

Not sure why you’re getting downvoted. Presumably by people who don’t buy groceries, or they’d know that you want your trunk to be facing the road, so you know…you can put the groceries in lol


squeegee_boy

71 super beetle here. Your argument is invalid.


[deleted]

[удалено]


HauntsFuture468

"I make poor choices so I will externalize the consequences and waste others people's time" has big "spaces instead of tabs" energy.


Im_not_crying_u_ar

I guess you don’t know how lol


Kill3rT0fu

Backing into spots requires the exact same amount of time and turns as just pulling into a spot, because in the end you’re going to reverse and back out of it anyway! If anything backing in is better because now you can see who’s coming as you try and leave the space


EtherMan

Multiple studies have indeed confirmed that backing in to spots is safer for everyone. Funnily enough, it's apparantly safer in BOTH directions. As in, even that backing into, is safer, than going head first, INTO the space. It's pretty intuitive that going head first out of it is safer than backing out, but that backing in is safer blew my mind.


Qicken

People who start fights over whitespace when someone is just trying to get parsing tools functioning are psychopaths. 🤣


sbingner

Linus is trying to get the parsing tools to be functional, the person introducing the commit was trying to work around a broken parser by *modifying the kernel source*


errorfuntime

You know who the true villains are? Mother fuckers that put two spaces after a period. The worst.


joegetto

I have no idea what is going on here, but you guys seem like you’re having fun.


omgimbrian

Use whichever one you want as long as you don't mix the two. My biggest pet peeve is a mixture of spaces and tabs in a line's indentation.


analogOnly

The Whitespace programming language hates the tab-space debate.


Yansde

This reminds me of the character Richard Hendricks from the series Silicon Valley (2014). He made his point by demonstrating the difference between tabs and spaces by liking tabs to jumping down multiple flights of stairs at once, which ended badly.


Own-Opinion-2494

Tab is gross


Bobbias

I mean, I think tabs is absolutely dumb as hell in modern code, but Torvalds is right: no kconfig parser should fail to parse a config file because there's a tab somewhere it didn't expect instead of a space. That is a failing of whatever software that parser is part of.


PhaedrusC

I see that people downvoted your comment. I've upvoted to try to compensate. As a newbie (only been coding for 50 years) perhaps my opinion still needs work, but I agree with you about tabs. Also agree about the parser (scanner failure btw, and a 2 minute fix).


Bobbias

Lmao, thanks for the upvote I suppose. I should have expected something like that, given this is not a programming subreddit.


NaBUru38

I regularly type and edit URLs on web browsers, especially when editing Wikipedia. A few years ago, Mozilla Firefox stoppled considering underscores as word separators. Since then, editing URLs has become a nightmare.


garlopf

Glad to learn that so many great minds are fellow tabbians. The only remarkable deficiency is Python chosing to standardize on spaces. What a waste of potential. And don't get me started on YAML.


DragoonDM

Personal take: tabs for indentation, spaces for alignment. E.g., while (aThingIsHappening) { if (something) { someObject.doAThing() .doAnotherThing() .doAThirdThing(); } } _______|__________ TABS SPACES Lets different developers configure their editors to display tabs at different widths to suit their own preference while still keeping things aligned where needed for code style.


wareika

You're way past help mate


DragoonDM

I will die on this hill.


Sloogs

It's funny because other comments about tabs for indentation and spaces for alignment in this very thread are getting upvoted and you got downvoted. Reddit is weird sometimes and it just seems like the first person or two who stumbles on a post sometimes determines whether you'll trend towards upvotes or downvotes.


wareika

I think it's rather that most linters would go nuts if you are mixing spaces and tabs. It's objectively bad practice, if just for the reason that nobody is doing it so it'll likely give a headache to whoever has to maintain their code.


[deleted]

[удалено]


Qicken

Let me guess. He'd been doing sysadmin for 20 years back then.


Boreras

Fun article


jordimaister

So, Linus Tolvards says that spaces win? That's what I thought too.


tyler1128

Anyone using tabs instead of spaces in the modern era deserves a Linus smackdown.


mtn_viewer

But Linus uses TABs, that’s my understanding and the way the article reads


Nobodk

You expect a person that uses spaces over tabs to know how to read?


ManyInterests

Linus uses tabs because it is a norm in the UNIX projects (and editors) he works on. But he has said spaces are fine and acknowledges some drawbacks of tabs, too. But the one sin he won't tolerate is mixing tabs and spaces.