Well Sup Forums Tabs or Spaces?

Well Sup Forums Tabs or Spaces?

Other urls found in this thread:

stackoverflow.blog/2017/06/15/developers-use-spaces-make-money-use-tabs/
twitter.com/NSFWRedditGif

Tabs that insert 2 spaces

Or whatever the source code uses

Tabs

I've experimented with tabs, but at the end of the day it was just a pain in the ass if you're working with anyone else. The unique selling point of tabs (that the user can define a custom indentation size) is actually a huge problem for code formatting.

1-to-1 in everything you do. Monospaced fonts and monospaced whitespace.

space if shit's monospaced

tabs ...BUT with spaces


didn't mean to blow your mind, kid

take care now

Tabs mostly. Just because i've gotten used to it since when I started.

tabs. maybe 4 spaces if you're working with an aspie

(checkd)

i use the same config. i have my tab be registered as 2xspaces.

Does anyone ever acrually think about this?

>Kid
lol

Python programmers have to

Pretty much this.

tabs for indentation
spaces for alignment

Anything else is retarded

Whatever convention is used at my workplace.

Only when I encounter someone else's code which has a mix of tabs and spaces in it. Which does kind of make me wonder why tabs were ever even an option to begin with, but obviously whoever shittily imported someone else's tab code and then used spaces himself in an inconsistent way is the one who's actually at fault.

I'm used to using tabs

Depends on the language. C, C++, Go tabs. Python, Ruby, Java, JavaScript, C# spaces.
JavaScript devs that do 2 spaces are hiding their shitty });});});

tabs. alignment can suck my dick

this
I can't give a fuck otherwise

...

Spaces with set expandtab so you can still hit tab, get the proper alignment, and it's spaces.

Hands down the best.

>code goes from development team to code review team
>code review team converts all tabs to spaces and sends code back
>development team converts spaces back to tabs.
this happens so fucking much where I'm at.

>C, C++, Go tabs.
Why?
>Python spaces
Makes sense
>Ruby, Java, JavaScript, C# spaces
Why?

It's language convention basically. It's more likely C/C++ devs will use tabs, and Go devs being suckless fags fucking love using tabs.
There is no PEP 8 but still the rule of the majority.

>2 spaces

This is why people like tabs, because people like you can set their editor to 2, while I'll be sitting nice and comfy at 4, and some insane person can use 8.

>Python spaces
>>Makes sense

How? Just started out with py but I use Tabs. Can you please explain why space > tabs in python?

Why don't you just use tabs with a custom width in your editor?

i tried 8 for a while after seeing the argument that it forces you to keep your nesting to a minimum, but it was just so ugly

Because the official style guide says so.

Whitespace has meaning, and almost every example is in spaces. I think tabs > spaces, but when it's both important and has a precedence set, it makes sense to follow it. I still use tabs regardless, but I can understand why someone would go spaces in python.

I've heard this argument before, but my natural inclination is to not nest. I don't really need any additional motivation to do so.

Well in that case I will keep using tabs aswell.

>Can you please explain why space > tabs in python
There is no innate advantage. In fact, it probably makes more sense to do it with tabs since you can maintain a strict 1 tab -> 1 level of indent relationship.
Yes, the official style guide says to use tabs, but you're free to use pep8 as toilet paper if you so desire.
Of course, if you're working on someone else's project, you should do whatever is in the project.

I don't have an option, my build won't pass any of the linting tests if I use the soy boy tabs.

Spaces, tabs are for switching indent levels with the editor.

What do you say Sup Forums?

Indented empty lines or unindented empty lines?

Fucking worst feature of the language. Literally every time I cope and paste there is inevitably some fuck up

Who cares? Everything's going through clang-format on pre-commit anyway

what the actual fuck??? unintended

Tabs are literally purpose built for indentation. It's the only thing it was meant to do.

1 tab = 1 level of indentation
2 tabs = 2 levels of indentation

Any program can change the tab width to make the indentation bigger or smaller, but using tabs gives a standardized level of indentation across all editors and formats.

Spaces are not indentation. If you want to increase or decrease the indentation width of a file using spaces for indentation, you cannot do so without ruining all of the spacing between the rest of the document. Do not use spaces for indentation.

but why?

Lines should never under any circumstances end with whitespace

because its hidden and unexpected to have random whitespace

If you'd ever used git patches you would already know the answer to this

It depends on whether the line is intended to be preserved. If it's empty, an editor or formatter would be justified in removing the line. If it's intentional to add spacing between two lines of code, then it should not be an empty line. Most editors and formatters will preserve non-empty lines, even if they only contain whitespace.

>go forces the use of tab
Well it's no wonder.

Damn. I know OP created this thread to troll. But your post is the icing on the cake.

>If it's empty, an editor would be justified in removing the line.
Like fuck it would

Spaces, nothing is worst than switching text editors or you don't have the same .vimrc you're used to and everything goes to shit because of tabs.

Fuck any IDE that makes this question relevant.

Curious, I expected this automatic rejection, but I'm curious to why.

Obviously if that whitespace is accidental or has no meaning it's bad, but why is maintaining a consistent indentation even across empty lines a bad thing?

Git functions fine with this. I'd even argue it functions better in cases where git gets confused at the start and end of a function. The diffs tend to spot the empty lines and interlace the old with the new (especially when matching final curly braces), but when the empty lines are all indented, it tends to force git to not interlace unrelated code.

Huh, I'm surprised so much XML uses space. You'd think that would be the perfect sterile environment to use tabs.

But I guess there's no such thing as something developed in "pure xml" and you want consistency across all languages you're using.

Would you be surprised if I told you I liked this style so much, that I managed to convinced my small team (5 programmers) to use this style, cloned the linter our company used from github, expanded its capabilities to be able to support and enforce this style, wrote unit tests, submitted a PR, and got it merged in?

>Git functions fine with this
I said git patches. Make and apply a patch that includes a line that ends with whitespace and git will loudly complain about it to you.

I would consider you to be Satan, the devil

Well not really suprised. I just despise the idea of doing this. I mean if it works for your company then why the hell not use it. It's viable but I still wouldn't do it.

>I said git patches. Make and apply a patch that includes a line that ends with whitespace and git will loudly complain about it to you.
That sounds like its problem.

Is this another one of those archaic "all files must end with a blank line because the pre-processor is autistic and spergs out if you don't for no reason other than its aforementioned autism" thing?

Oh, you just mean the warning.
git config --global apply.whitespace nowarn

Lord of darkness at your service

No joke, one of my colleague uses 3 spaces, just to fit into a *120 char long line*

>2
>4
>8
Has anyone ever heard of someone using 6 spaces?

There's 6 and 3, but they are less likely. To be honest, I've heard of more people using 3 and 6 more than 8, but a lot of programs set 8 at default.

I've never heard of 1, 5, 7, or 9+ spaces. The oddest one I've see is a coworker who made an plugin to his editor to have fibonacci spaces, so that it got more drastic each level of indentation.

>fibonacchi indentation
Sounds like something, that should be mandatory. Although it should start with 2

Tabs indent, spaces align.

And while we're at it, Stroustrup indentation.

tabs

• They're specifically meant for indentation.
• They allow developers with different preferences in indentation size to change how the code looks without changing the code (separation of data and presentation for the proverbial win!)
• It's impossible to half-indent something with tabs.So when you copy code from some website that used 3 spaces into your 4-space indented file, you don't have to deal with misalignment.
• are more productive, why press backspace 4 times per indent instead of once.
• takes less size than multiple spaces.

2 space master race

>not cuddling your else
you monster

stackoverflow.blog/2017/06/15/developers-use-spaces-make-money-use-tabs/
>Do you use tabs or spaces for code indentation?
>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
Eat shit and die, tab-whores

>tabs

I cannot fathom how people can justify using spaces instead of tabs for indentation.
There is literally no conceivable upside.

I'm a C++ programmer, so I naturally use tabs.

I get unreasonably upset thinking about using spaces.

Correlation doesn't imply causation. Try again. This statistic has a million hidden and unaccounted variables. For example, more successful developers may be more prone to following coding standards, and most if not all coding standards demand spaces.

>They're specifically meant for indentation.
Tabulators are meant for creating tables, as implied by the name.

>are more productive, why press backspace 4 times per indent instead of once
This is why people argue about this. Because retards who use tabs think that using spaces means that they are pressing space four times.

IDE controlled indentation

void Function()
{
mods=fags;
}

Anyone using
Function(){

Should be hanged and/or sent to 80s.

tabs

spaces make sense if you're too stupid to understand how computers work or if you're working with other people who don't understand how computers work.