Indent width

What is the optimal indent width?

Other urls found in this thread:

google.github.io/styleguide/htmlcssguide.html#Indentation
github.com/google/styleguide
twitter.com/SFWRedditGifs

4,6 cm

One tab, then set up the visual width of the tab in your editor to whatever you want it to be. Uses spaces for aligning.

...

4. But I've seen 3 being used and it's pretty good.

/thread

10

5 spaces

Linux kernel uses 8
Everything Linus does is right so the best is 8

It varies for me because I like to put the comments before the code.

...

Linus doesn't use nested callbacks to make full stack web applications. If he used a modern language with powerful functional features instead of something from the stone age, then he'd realize that using a 2-space indentation is the optimal setting.

this tbh

use promises and futures

Everybody laugh at this troglodyte. What is this, 2015?

>align all of the code nicely using fucking spaces and tabs after the comment

...

8 is too much spacing, 2 is too little, 4 is just right.
also if you use spaces instead of tabs you need to kys.

2 but it's all moving to 1

8 is too much spacing, 2 is too little, 4 is just right.
also if you use tabs instead of spaces you need to kys.

spaces of tabs > tabs
4.

...

Anything larger than 4 is shit.
Using spaces instead of a tab is cancer.

I can forgive your tab size preference because it's basically a visual setting just like syntax highlighting, but if you use spaces you should either stop writing code forever or kill yourself.

- Jeff Atwood, founder of Stackoverflow

convincing argument to do everything opposite of what he says

THIS

i hope you don't do this, user.

this with tab width = 6 spaces

Linus is a higher grade of programmer. He doesn't bother with skiddy JS frameworks and hipster ruby on rails, because he has something called self respect

Go outside kid. A lot of apps are built in either C or C++. OOP is trash so C it is.

8

what does gnu use?
what does the gnoonix kernel use?

8.

Ideal settings coming through.

4 spaces for tabs.
72 column width (NO EXCEPTIONS).
Variable and function names as long as they need to be.
Use human readable variable and function names that are as long as they need to be but, no longer than two words.
Words are in all lowercase and separated by an underscore.
No numbers in names.
New line between logical blocks such as conditionals and loops
Two new lines between between function definitions and whatever OOP crap you have.
Comment anything that cannot be explained with variable names.

But above all:
GET RID OF CARRIAGE RETURNS HOLY FUCK

...

Enjoy your incompatibilities.

you monster

I use 8 column wide tabs, and spaces for alignment.
Roughly ~80 column lines.

It annoys me how many editors default to 8. I can barely stomach 4.

The recommended for the Web these days is 2.

Who even makes those recommendations?

Google

google.github.io/styleguide/htmlcssguide.html#Indentation

Alright, fine by me.

0

-9

They say the same for the other languages.

github.com/google/styleguide
Huh, didn't know they had style guides for other languages.

"Tab == 3 spaces."
-- God

Zero is the optimal indent width.

I just use tab stops, so that's about 8 spaces, unless you changed that in your editor. I don't ever bother to change it, so whatever code I write should fit on every 80-column terminal.

t. freech

0 reasons not to do this, everyone wins and it's fewer bytes, 0 drawbacks.

worst idea ever