The Great Debate

The Great Debate

Other urls found in this thread:

lea.verou.me/2012/01/why-tabs-are-clearly-superior/
youtube.com/watch?v=SsoOG6ZeyUI
stackoverflow.blog/2017/06/15/developers-use-spaces-make-money-use-tabs/
kernel.org/doc/html/v4.10/process/coding-style.html
en.wikipedia.org/wiki/Argument_from_authority
en.wikipedia.org/wiki/The_C_Programming_Language
twitter.com/SFWRedditGifs

There shouldn't be a debate here. Tabs are, by definition, one level of INDENTATION.

You should use tabs to indent, spaces to align or separate.

If you do this then people can adjust their tab-width to fit their personal visual preferences without modifying the contents of the file. It separates how you write code from how you read that code.

Now, time for a real question: Asuka or Rei?

Here you go: lea.verou.me/2012/01/why-tabs-are-clearly-superior/

qt3.14 Rei, all dei

>Lea Verou
I now regret my contributions to Bliss.js
Burn the witch.

You should always use spaces because most editors use them by default and using tabs might generate conflicts in git when other users are most likely to use spaces

>writing some shit in javascript
>regretting it afterwards

No surprise

Obviously tabs

This, it takes a special kind of autism to fill your code/script with a huge amount of spaces when you could just indent levels with a single push of a button.

If I have to copypasta someone else's stuff and I dont like the indentation scheme, ill have to backspace AND arrow key navigate through all their crap just to get it all leveled out so that I can Tab it.

grrrr
these fuckers need to get with the program and make their editors do tabs by default
> some languages like YAML deal in spaces but editors like Notepad++ will automatically consider this most of the time

With a good editor you can usually fix people's shitty space-indention, but sometimes it takes a bit of extra work

In VIM you can use a regular expression to find and replace spaces with tabs, or in Atom/Sublime/Cloud9 there's a "convert spaces to tabs" button. Although the "convert spaces to tabs" button can fail if you have different types of tabs within a file - so you sometimes need to open a new (temporary) file, fix the tabs there, then paste it into your code.

>"You should always use the feudal system because most countries use it by default"

Just because people do things badly doesn't mean we should always do it that way. I have faith that in time people will start fixing their code.

Tabs literally exist for the sole purpose of indentation. Anyone who says otherwise has gone backwards through the stages of evolution. Not to mention, people can change tab width to their personal preferences.

youtube.com/watch?v=SsoOG6ZeyUI

this is the ideal-world answer
sadly, the correct RL answer is "consistency uber alles"
don't create unnecessary work for your coworkers because of your autism, kids. You don't have the social capital to spare.

>Tabs literally exist for the sole purpose of indentation.

Do they?

I thought they were invented to separate columns in tables? (so they line up)

Asuka always and for ever, was also my first waifu.
also regarding OP tabs

I think spaces could use a little defense here:
>Less space.
Any distribution which is concerned about space goes through a packing process before delivery, so this point seems irrelevant.
>Can be personalized.
Isn't this the kind of mentality that leads project members to allow their text editor to rewrite tab/space/newline settings? Don't you conform to the standards of the project you work in? if you merrily let your editor handle it settings who knows what kind of havoc you can create?(answer: the guy who manages the repo knows).
>Better for collaboration.
The best thing for collaboration is the thing which creates consistency among collaborators, a view which maps 1:1 to representation is what creates that. If you had said 'better for balkanization of code by letting each dev set their own standards', I'd wholeheartedly agree with you.
>Certain tools.
I don't depend on auto-spacing any more than you depend on auto-indention. Yes this is a useful feature which save me many keystrokes, but no I would not suddenly regret my decision. In fact often times when I'm in a remote editor or using raw text for something that I am pleased at the uniformity spaces provide. So I would say the person noodling with how their tabs look is they guy depending on a tool. My code always looks right, in any editor, all day.
>Easy to select.
I usually band, line or block select, so this drawback isn't something I'd considered. If I use a select within the editor I can easily select indentation by selecting a string of continuous chars, so again... not something that impacts me. Most importantly, if I walk over to someone else's editor under a 'spaces' regime I don't see what looks like a ransom note from a third person mingling spaces and tabs without realizing it. For some reason it's always *that* guy that wants the whole project to switch to tabs.


Spaces aren't evil. Spaces mixed with tabs just wreck readability. completely.

tabs, anyone who says spaces just can't figure out how to configure their text editor

Tabs for indentation and spaces for aligning. Users can adjust tab width to their liking with no chance of messing up the formatting. I see no reason to do it any other way.

Tabs are superior (spaces? seriously?), but you should follow the conventions at your workplace

>femdom waifu
degenerates like you etc etc

Yes, but not in a language like lisp where indentation is not left up to individual preference. That language becomes hell if we all don't follow sane standards

stackoverflow.blog/2017/06/15/developers-use-spaces-make-money-use-tabs/
>This is a bit of a “holy war” among software developers; one that’s been the subject of many debates and in-jokes. I use spaces, but I never thought it was particularly important. But today we’re releasing the raw data behind the Stack Overflow 2017 Developer Survey, and some analysis suggests this choice matters more than I expected.

>Spaces make more money than tabs

Html so why's it matter?

:set tabstop=4

To be fair tabs are much nicer looking than spaces..

Makes some stuff easier to read too.

Why would you not tab for every indent?

Do people really go ONE TWO A THREEEEE FOUR on their space bar every single time they indent?

fpbp

Your visual preferences don't matter for our shared codebase

what's creating the extra work is the people using spaces which then have to be converted back to something useful

i use hashtags, im pretty radical

If you're using the tab character for indentation just because that's its only purpose then I hope you're also using backticks to start any quotes and the dedicated em/en-dash characters for any dashes (not hyphens) and the dedicated large space character to follow periods.

>things that first year CS students say

In just about any IDE with smart space indenting you can press tab once for 4/8 tabs and delete full indentation levels with one press, too. And use a fucking linter.

>Isn't this the kind of mentality that leads project members to allow their text editor to rewrite tab/space/newline settings? Don't you conform to the standards of the project you work in?
This is probably part of the misunderstanding. It's editors that do replace tabs with spaces that cause this problem, not the editors which treat tabs as tabs. The idea is that the editor can customize a tab to appear like n spaces, but without actually changing them to spaces like broken editors do.

Why do you keep insisting that only works one way? Are you mentally deficient?

Precisely this.

>Any distribution which is concerned about space goes through a packing process before delivery, so this point seems irrelevant.
I agree. This point is just a ridiculous excuse to get cheap points.

>Isn't this the kind of mentality that leads project members to allow their text editor to rewrite tab/space/newline settings? Don't you conform to the standards of the project you work in?
No. The mentality, and project standard in sensible project, is that the format of the source file is fixed (indent with tabs) which can then be viewed using the preferences of the individual programmer.

>if you merrily let your editor handle it settings who knows what kind of havoc you can create?
The rule here is that there are strict standards on what is saved in the repository (which your editor most decidedly must NOT mess with), and absolutely zero standards of how you want to render that on your end (go wild).

>The best thing for collaboration is the thing which creates consistency among collaborators,
Why? You don't require you and me to use the same editor color scheme, do you? Why should we use the same indentation length? The best thing for collaboration is if everyone can use their tools in the way they prefer, while keeping the *interchange medium* (read: the actual source files that are in the repository) strictly standardized.

>Certain tools.
>Easy to select.
More filler arguments, so no comment here. I don't necessarily disagree with these points, but I do think they are entirely irrelevant in the larger context of the discussion.

>Spaces mixed with tabs just wreck readability. completely.
How so? That -webkit-transition example works perfectly.
The real point is that tabs in any location other than the immediate start of the line wrecks things. But that is no point against the tabs-followed-by-spaces style discussed in the article.

No, the developers of editors which automatically replace tabs with spaces are (as are users who configure their editors to do such).

What will we have next, editors which replace underscores with hyphens because "lispy style identifiers look better than c-style ones"?

>using a different level of indentation from the rest of the codebase because you like the way it looks
nobody does this
it breaks down as soon as you have something like this:

long_function_many_arguments(
shrt_arg, related_to_short_arg,
longer_argu, related_to_longer_argu
);

You might use a similarly declared array for execl(3)

Ah, this font isn't monospace...

long_function_many_arguments(
shrt_arg, related_to_short_arg,
longer_argu, related_to_longer_argu
);
[/code\

>Why do you keep insisting that only works one way?
Not that user, but the transformation is irreversible, because it throws away information.

Consider the following code from the article, spaces replaced with underscores for clarity:
div {
-webkit-transition: 1s;
___-moz-transition: 1s;
________transition: 1s;
}

Once you replace those tabs with spaces, you aren't getting the pattern back. Because that last line should not get multiple tabs, even though there are enough spaces to make up multiple tabs.

>I don't know what SCM is

This doesn't break down. Why would it?

If you have a tab at the beginning of the line and spaces between the first and second argument on each line, as it should be, then that will work with any tab size you like.

Please elaborate what the fuck SCM has to do with anything I said in . Protip: it doesn't.

The correct answer is tabs.
Fuck everyone who uses spaces.
Fuck the Rust style guidelines.
Fucking retards.

>I agree. This point is just a ridiculous excuse to get cheap points.

I generally strive to follow programming guidelines. Consistency is great. But two things that I absolutely will not fucking stand for are spaces for indentation, or opening braces on new lines. Fuck that gay retarded shit so much.

I'll do the array I was thinking of this time

Orig:

const char *argv[] = {
program_name,
-a, 1,
-thing, 2
}
//2nd line has a 4-space smart tab


Then some snowflake comes along and changes a tab to be 2:

const char *argv[] = {
program_name,
-a, 1,
-thing, 2
}


then someone who should really stop writing code in a landscape editor comes along and changes it to 8

const char *argv[] = {
program_name,
-a, 1,
-thing, 2
}

>opening braces on new lines
You lost me. That's like saying you won't stand for someones favorite color if it's red and not blue.

Remember:
>If you have a tab at the beginning of the line and spaces between the first and second argument on each line, as it should be,

So that code should be formatted as:
const char *argv[] = {
program_name,
-a,_____1,
-thing,_2
}


And renders like this for 2-space and 8-space tabs:
const char *argv[] = {
program_name,
-a,_____1,
-thing,_2
}


const char *argv[] = {
program_name,
-a,_____1,
-thing,_2
}


This is known as "indent with tabs align with spaces", and is what pretty much everyone advocating for tabs is talking about. OP certainly is.

>Less space
You're not going to strip white space out of source code pajeet.
>Can be personalized
>Isn't this the kind of mentality that leads project members to allow their text editor to rewrite tab/space/newline settings?
No, you just lack critical thinking. If you use spaces to indent, your editor has to be configured to print the appropriate number of spaces when you press tab (I *SERIOUSLY* hope you're not tapping on your space bar like a fucking neanderthal), and if you want more less indentation, your editor now has to do what you're talking about, and add and remove spaces, since a space is a space and can't really be shortened or lengthened. If you use tab characters, changing it just means you change how your editor *displays* tab characters; there's still just one tab whether it looks like 2, 3, 4, 8, or however many spaces in your editor.
>Better for collaboration
See above. One character to denote a level of indentation (what the tab character was made for) is superior for consistency than trying to recreate the affect with spaces.

In short, you're retarded.

So, for people who use , for the spaces between -a and 1 would have to do the thing they say people who use spaces do and manually press space? Wow, ironic.

I wasn't talking about tabs vs spaces for this though, I was talking about people who act as if anyone regularly changes the tab size of a file to suit their preferences.

It's not a great debate, it's a debate among CS students who've never had a job and people asking Sup Forums if it's hard to learn [whatever language they're going to do fizzbuzz in this week]. People who do this for a living have more important things to worry about and follow the coding standards.

>So, for people who use , for the spaces between -a and 1 would have to do the thing they say people who use spaces do and manually press space? Wow, ironic.
I'm sure you can configure your editor to do tab-to-space when not at the start of a line if you like. Mostly I very rarely align things like that at all (I feel it's almost never an improvement on readability).

>I wasn't talking about tabs vs spaces for this though, I was talking about people who act as if anyone regularly changes the tab size of a file to suit their preferences.
I don't think anyone regularly changes the tab size. Your preferences are fairly static, after all. Rather, people have the tab size of their editor set to what they like, which may well be different from the tab size of the guy next to them working on the same project. That is definitely very common and works fine.

kernel.org/doc/html/v4.10/process/coding-style.html

>People who do this for a living have more important things to worry about and follow the coding standards.
Of course. The relevant question is what coding standards to use for a new project. (Well, maybe it's not a very *relevant* question, but it's a poignant one.)

>it's almost never an improvement on readability
This.

>kernel.org/doc/html/v4.10/process/coding-style.html
>Heretic people all over the world have claimed that this inconsistency is ... well ... inconsistent, but all right-thinking people know that (a) K&R are right and (b) K&R are right. Besides, functions are special anyway (you can’t nest them in C).

So their argument is "We're right because we're right". Wow it's fucking nothing.

Do you Tab enablers not follow PEP8 when coding in Python?

>not even about tabs v. spaces
>doubting K&R
Read a fucking book, pajeet.

Nonono, their argument is "someone else is right and that someone else is way cooler than you are, so suck it"

Citing to authority is not an argument.

I don't. Language standards can go eat a bag of cocks. My python projects use the standards that I like, not the standards that Guido lines.

(But then I don't use much python in the first place, because "do things the way Guido likes" is kind of a general theme in Python. Fuck that shit.)

>implying

It is, actually, when the authority in question is in fact an authority. This doesn't work in science, as, hypothetically, there is no authority or dogma to appeal to, but in this case citing the men who developed the C language and wrote *THE* C programming book and who are widely considered Gods in C programming circles (see the coding style standard) is perfectly valid.

So "Because I said so" is an actual argument?
I disagree, I don't recognize your authority.

>not using the vastly superior tab space

...

this. tabs are for indentation, spaces are for spaces between characters.

en.wikipedia.org/wiki/Argument_from_authority
en.wikipedia.org/wiki/The_C_Programming_Language
Go back to India, pajeets. It's not an objective argument. How are you going to deductively prove one is better? You can't.

>Not understanding what a logical fallacy is

Tabs. Do people really use spaces?

I bet they do, but they are just degenerates

>t. autist got his statistics wrong
>"A serial killer ate ice-cream before he went on a murder-spree, therefore eating ice-cream makes you a serial killer"
can you see why this statistic is wrong?

>can't even read
Seriously, go back to India.

>Obsession with India
>Not having a loo to poo

...

tabs {
│‧‧‧‧‧‧‧for indentation {
│‧‧‧‧‧‧‧│‧‧‧‧‧‧‧spaces = for
│‧‧‧‧‧‧‧│‧‧‧‧‧‧‧ + alignment;
│‧‧‧‧‧‧‧}
}

user understands.

I wish I knew how to code in more languages, or care enough to bother to find some code...

>why I use spaces, though with tab key writing 4 spaces

if you agree that one should not mix whitespace
then how the fuck do you align code properly in most popular languages?

theres just no way that tab will align you nicely code in relation to previous/next line and brackets there or other stuff.

see

>mixing
observe picture

>Being autistic
see

>vim
>regex to replace spaces with tabs
>not using gg=G instead when vimrc is already set to use tabs
Why not search for a single space and if you find in a series replace them with a tab when you're already being retarded?

spaces

>if you agree that one should not mix whitespace
I don't. What is wrong with that?

tabs

It's a readability issue.

Yeah, it makes it harder to read.

Exactly, which is why I want them on the same line. It's well known that this is the superior option. It's more balanced, with one line opening a scope and one line (the closing brace) closing the scope.

>rust fags

lol, i remember the argument they had over the name of the warning for "bad_style" because it might hurt some "peoples" feelings