Tabs or spaces ??

Tabs or spaces ??

Tabs as spaces

fpbp.


Also, 2, 4 or 8 spaces?

tabs

a single logical indent unit, displayable at any width you want to fit your screen and taste

using spaces is an anti-design as not everyone wants the same indent width, and you're using a group of multiple characters to denote what is essentially only 1 logical thing

dinosaurs who complain tabs mess up alignment are making ascii art, not code

Besides, I often align blocks of code to each other (like chopping down long methods with many parameters), and using tabs for it does not mess it up. I don't know what some fuckhead complaining about alignment is even trying to do.

7 spaces

NEWLINES

tabs and spaces

Yes.

Tabs to indent, spaces to align.

Tabs for indentation, spaces for aligning.

This. Tab width can be configured to whatever you like, and it doesn't fuck up alignment.

Whatever my editor autoindents to. If I have to do it manually then one space

I'm a nigger so I use spaces.

most people use spaces which means most people are doing it wrong.


Tabs are 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 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.
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.

Automatic indent in spacemacs, i never press tab.

what do you mean by "spaces for aligning"?

Tabs

void fuck(int a, int b,
int c, int d) { /* Spaces to align */
if (c > d) {
/* Tabs to indent */
}
}

whatever the style guide I should follow say

Ihavedisabledmyspacebartopreventmyselffrommakingawfulcode

Who the fuck cares, use whatever the project is already using.
If a new project, use whatever the text editor/ide is using.

If you're indenting so far it becomes an issue, then your problem isn't the matter if it's tabs or spaces, kill yourself.

Spaces with 4 spaces per tab.

Anyone who argues otherwise is wrong.

Tabs are meant for making tables.

Didn't someone scrape github and plot that pajeets use tabs and old men use spaces?

Something to do with early programming not being tab-friendly

>open project
>3 spaces
fucking why

4 imho

in my experience of hiring indians to hash out code for me when I was in a crunch, they always return it full of spaces

>Use tab
>Illegal mnemonic specified

E
n
t
e
r

t
b
h

f
a
m
.

4

why would you do this?

Tabs for block indentation, spaces for everything else. Why? Block indentation size can be variable, depending on the taste of the writer/reader and it gives each block level a semantic meaning because just one character is needed instead of multiple when spaces are being used. Anyone who disagrees is just utterly stupid.

...

foo() {
if (
bar
&& baz
|| qux
) {
return 1
+ 2
+ 3;
}
}

\t

w h y

From the kernel style guide:
>Outside of comments, documentation and except in Kconfig, spaces are never used for indentation, and the above example is deliberately broken.

this was just an example... imagine all expressions being long and possible even multiline...
that's why is the correct answer

I understand the example, but why would you try to line that stuff up like that when it's not a new line? why would you line it up like that when it's so tied to what came before it? I've done this before but not for a long time and I'm obsessive, so I can't think of an actual good reason to do it

>your computer rules over your code
Good call, faggot

4

Hi, Pajeet

3