Well?

Well?

Other urls found in this thread:

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

tabs as spaces

There is not a single good reason not to use tabs. Being able to look at any code using your preferred indentation width is a godsend. The only time that spaces are ever better are when you're entering code into a website, but even then, the website should add support for tabs.

>Being able to look at any code using your preferred indentation width is a godsend.
I don't understand why this is such an issue for people. Does it really make a difference if it's 2 wide vs 4 wide?

Yes

Spaces.
Tabs to indent, spaces to align would be ideal, but it's too easy for people to fuck up.

yes, and i agree with what said, but i still dont like tabs
>4 space indentation masterrace

Tabs obviously. How do you expect me to read spaces?

how is this even a thing in 2018

its tabs that produce spaces. if you're using tabs that make \ts in 2018, you're seriously doing something wrong and you most definitely are not a professional software engineer

the real question is 2 spaces vs 4 spaces, and that depends on what you're doing. you pretty much need 2 spaces for react

I use spaces at work, but...
Tabs.

Tabs take up only one character.
Tabs you can resize and customize.
Tabs you can convert to spaces at any time, not vice versa.

Tabs were literally made for this. But honestly, it's not that big of a deal. I can deal with both and won't sperg out about it.

Personal stuff? Always tabs with tab width set to my liking
Work stuff? Follow the code base of course
New work stuff? Tabs if I can

>I use spaces at work
I wonder why?

8 spaces, kernel style.
4 spaces is "acceptable", 2 spaces is a crime.

Because my coworker was the one who wrote the coding style guidelines. He mostly copied them from some Twitter account rants.

>Tabs to indent, spaces to align would be ideal, but it's too easy for people to fuck up.
Anyone without the minimum amount of brain cells required to do indentation correctly is someone I honestly don't want anywhere near my codebase no matter how it might be formatted.

>how is this even a thing in 2018
It's a thing because as you have shown, people who think spaces are a good idea for indentation are still here in 2018. If you were to remedy that, the rest of us would be much obliged.

>2 spaces for react
>not professional software engineer

How can you lack self awareness to this degree?

Tabs. Fuck anyone who insists on spaces. Fuck them to hell and back. I generally try to follow whatever guidelines because consistency is important, but I'm not going to lower myself to that level for those stupid shitty brainlet retards. Pic related.

Languages should not come with formatting guidelines in the first place. Formatting guidelines belong with projects, not languages; the whole point of leaving them to the programmer is that the language itself shouldn't give a fuck and leave you to do what YOU think is best. Fuck any and all guidelines that come with programming languages, no matter the topic.

tabs.
takes only one push to go over """ 4 spaces" of whitespace.
I hate other peoples code when they do that 4xspace shit.

Single space.
I'm going to hell.

Used to be a tabs guys but since working with languages like clojure where you need to constantly align I prefer spaces (by converting tabs to 2/4 spaces). I'm also not really a fan of "tabs for indents, spaces for alignment" as it just fucks up the code in the long run.

And honestly it's 2018 now and we have advanced enough programs that can convert tabs to spaces back and forth as much as you like, so the whole argument about incompatibility or being able to set the indent space to your liking is obsolete.

>I'm also not really a fan of "tabs for indents, spaces for alignment" as it just fucks up the code in the long run.
How so?

>And honestly it's 2018 now and we have advanced enough programs that can convert tabs to spaces back and forth as much as you like,
You can't automatically convert from spaces to "tabs for indents spaces for alignment" though, as the reverse transformation is not information-preserving.

Tabs

Tabs are a waste of space, 80 cols max

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

If you later move lines around, having to change their indents and alignments. Using "tabs for indents spaces for alignment" is pretty much unusable for things like SQL scripts and Clojure

>web development

>some analysis suggests this choice matters
come fucking on, wtf is this? what are you gonna tell me next? that its raining because wants it to rain?

>If you later move lines around, having to change their indents and alignments.
That is true for all indentation schemes. Tabs/spaces make no difference here.

>Using "tabs for indents spaces for alignment" is pretty much unusable for things like SQL scripts
Hm? I do that all the time. Works fine.

>and Clojure
Granted. It works for languages that use block-logical indent styles, not lisp-style indents. (Personally I think that C-style indentation on lisps would actually work fine, and better than classic lisp style. But I don't have enough lisp experience to have a confident opinion here, so I don't take that idea too seriously.)

let me fix that for you
>
there, much better

Inside of a function? 2 spaces, flat. Everything that can be done inline, should. 80 columns wide.

Mission. Critical. Standards.

>tab key included on every keyboard ever made
>convenient to reach
>literally exists to insert a gap larger than one space
but no, let's mash the spacebar like a monkey to achieve the same result

No one presses the spacebar to indent. We're arguing tab character vs space characters.

>retards who think that people who use spaces press "space" multiple times
EVERY SINGLE TIME

I hope I'm just getting trolled.

can someone tell me why exactly you'd want your editor to replace a tab press with a bunch of spaces?
like what is the advantage to this?
why not just leave it as a tab

Because you should be using spaces and this just makes it easier to do indents.

>you should be using spaces
>this just makes it easier
are you joking or do you not realise you haven't actually said anything that answers that question

Retard question

Does using spaces result in higher file size?

>why exactly you'd want your editor to replace a tab press with a bunch of spaces
It makes it easier to create indents when you're using spaces (as you should).
>what is the advantage to this
It's faster.
>why not just leave it as a tab
All "advantages" of tabs except file size break the moment you want to do something like pic related.

Tabs are for creating tables, not for indents.

not if you use 1 space indentation

Spaces and convert tabs to spaces.

Source code should reflect authors intention (and indentation is part of that) as the author intended regardless what you prefer. And spaces kind of enforce that.

Also I've never seen a source code where someone used tabs exclusively. Usually it's allot of tabs and occasional space indentation (facilitated by IDE intellisense or just lazy developer) and when you load that file into your own environment, and you don't have same tab sized as the author, all shit looks retarted.

Fuck tabs.

>It makes it easier to create indents when you're using spaces (as you should).
how does it make it easier and why should I?
>It's faster.
what the fuck?

>Source code should reflect authors intention (and indentation is part of that) as the author intended regardless what you prefer.
Why? Why shouldn't it reflect viewer's preferences?

>Also I've never seen a source code where someone used tabs exclusively.
Then perhaps you should start reading some nontrivial amounts of actual code before forming opinions on this. It is not exactly uncommon.

>when someone used tabs exclusively. Usually it's allot of tabs and occasional space indentation
???
>when someone uses tabs exclusively
>usually it's not exclusively tabs
I don't understand

>how does it make it easier
One key press versus 2 or 4 or however deep you want your indent.
>why should I
See third answer in >what the fuck?
See above above.

>Why? Why shouldn't it reflect viewer's preferences?
See pic related in You can't create that indent without mixing tabs and spaces. Changing tab width fucks it up.

Sometime, you have to use spaces, and your text editor goes full retard with auto-indent.

>One key press versus 2 or 4
in case you weren't aware, friend, a tab is one key press as well

>All "advantages" of tabs except file size break the moment you want to do something like pic related.
>You can't create that indent without mixing tabs and spaces. Changing tab width fucks it up.
nobody uses tabs for that kind of alignment
tabs are for scope, if you want to line things up with another line of course you use fixed width characters

>See pic related in
That's a limitation on what we CAN accomplish, not on what code SHOULD look like.

>You can't create that indent without mixing tabs and spaces.
So mix tabs and spaces. Indent with tabs, align with spaces. Which is what pretty much everyone advocating for tabs says.

>Changing tab width fucks it up.
But it doesn't. That's the whole point.

yes there is. distance is different in different programs

using tabbed spaces is better in every way

I know, I've been reading this for years.

tabs is the only way, who the fuck uses spaces?

>he doesnt expand tab

I heard from some colleges that spaces is universal and thus does not cause fuckery between machines.
Is this true?

they think they're using tabs exclusively, just go browse github

Boy, Python must make you really angry.

Tabs master race here.

Not angry, just disappointed.

It's a bit unrelated, and I know OP's pic is sublime text but how do I make emacs highlight only the part of the file that actually contain text instead of the whole buffer line?

>t. pythonfag
have fun with 30 inner loops at once

even a shit team code review wouldn't allow it

>>literally exists to insert a gap larger than one space

No it doesn't. It was created to move between cells in tabular data (hence the name).

The original ASCII standard says printable characters start with space (32 in decimal) but tab is 9, which means its a dumb terminal control character.

The escape key on the keyboard also has an ASCII value, but few people advocate putting escape characters in text files

tabs = 4 spaces

>distance is different in different programs
so fucking what?

I've always used spaces, mostly because I used to use a fairly complex and ugly alignment style. But I just did a grep of my recent projects, and the only places I didn't use a multiple of 4 spaces were stuff the second line here:
if(
isprint( err_string_buffer[ 0 ] )
&& isprint( err_string_buffer[ 1 ] )
&& isprint( err_string_buffer[ 2 ] )
&& isprint( err_string_buffer[ 3 ] )
)
...
where it's being aligned relative to something at the same indentation level. So yeah, I might try switching to tabs.

tabs are dumb and if you disagree you dont deal with pull requests

tabs are literally for retards who don't actually write code professionally

90% of the world uses spaces. please die dumb editor ricing retards

I generally align that like:
function voo()
{
if (
isprint( err_string_buffer[ 0 ] )
&& isprint( err_string_buffer[ 1 ] )
&& isprint( err_string_buffer[ 2 ] )
&& isprint( err_string_buffer[ 3 ] )
)
}


Works like a charm.

That means the code looks the same no matter where you view it and it doesnt fuck up your alignment when you use a mix of tabs and spaces.

>but what about muh preferences for how far a scope indents?
so fucking what?

Accept how far a indent goes for a language. That's why style-guidelines exist

>Not 8
Kys.

>pressing 4 times space
You fucking plebs, just configure your IDE to convert 1 tab into 4 spaces and problem is solved.
Anyone using anything else if a retard.