Tabs versus Spaces

Ethan Sanders
Ethan Sanders

The great debate.

All urls found in this thread:
https://www.gnu.org/software/emacs/manual/html_node/emacs/Just-Spaces.html
Benjamin Ward
Benjamin Ward

tabs because i'm not a barbarian and realize that people can set their own tab widths

Austin Diaz
Austin Diaz

Are those dots supposed to represent spaces? What kind of mongoloid made this cartoon?

Robert Gutierrez
Robert Gutierrez

this
i like using 2 space tabs at work but 4 space tabs on my laptop
they're pretty common if you've ever used invisible characters in word or your text editor

Jaxon Collins
Jaxon Collins

Tabs are the obvious choice. Each tab is a single character representing an indentation, not some arbitrary number of spaces

Isaac Powell
Isaac Powell

three (3) spaces on the first indent
subsequent indents are two

Oliver Ward
Oliver Ward

Not using automatic indentation

Are you coding with Word ?
Even Vim has automatic indentation by default (simulate tab not 4 monkeys spaces btw).

Jacob Stewart
Jacob Stewart

I like both, so I mix them in my python scripts. ;^)

Ayden Campbell
Ayden Campbell

Tabs, by far. 5 space tabs are the most readable, but I understand that others are fucking faggots and prefer 3 spaces.

Jeremiah Bennett
Jeremiah Bennett

Topkek

Owen Miller
Owen Miller

spaces. I shouldn't need to explain my choice.

Juan Thomas
Juan Thomas

I just press enter, every normal IDE automatically formats the text

Logan Edwards
Logan Edwards

I don't care since my editor indents for me. I drop a .dir-locals.el in the root of each project conforming to the style guide, since everyone is their own special snowflake with their own indentation style.

Evan Cruz
Evan Cruz

So tabs, then.

Levi Butler
Levi Butler

indents
That's irrelevant. Every editor autoindents; Vim autoindents. The point is are those autoindents spaces or tabs? Are you too stupid to understand this?

Hunter Gray
Hunter Gray

4 spaces macro bound to the tab key

checkmate

Julian Gray
Julian Gray

tabs, unless my code is shit and I need like 9 levels of indentation. Which is never, since I'm not shit.

Carter Thompson
Carter Thompson

It doesn't matter? Each project has a style guide, I just follow the style guide instead of whining like an autistic child.

Jose Johnson
Jose Johnson

Tabs indent, spaces align.
Failing that, spaces only.
Tabs only is heresy.

Isaac Stewart
Isaac Stewart

You're the only actual autistic in this thread.

Jace Diaz
Jace Diaz

unless writing lisp, there is absolutely no reason to indent with spaces. it's about time editors got elastic tabstops, which would render that rule obsolete as well.

die

Henry Harris
Henry Harris

I agree, but if you're using languages with an official recommendation to use spaces (e.g. Python, Scala) you're better off following them. Tabs are a must everywhere else though.

Colton Bailey
Colton Bailey

Can anyone explain to me why you wouldn't use tabs?

William Turner
William Turner

If you use tabs to align, then you'll get alignment issues on other platforms.

Jace King
Jace King

It's because you're retarded
Class
Method
If
Loop
Nested loop
If
Loop
Switch
Case
How's counting out a million spaces going for you
Because that's what happens

Lincoln Parker
Lincoln Parker

Adjust your tabstops then you idiot. it's either 4 or 8 columns, no one uses anything else.

And again, elastic tabstops would shoot this crappy argument in the head.

Christian Allen
Christian Allen

Then you still have portability issues because nobody uses elastic tabstops.

Benjamin Diaz
Benjamin Diaz

That's why they should be widely implemented all at once.

Anyway, your use of spaces breaks portability with my proportional typeface.

Gavin James
Gavin James

Try to edit your tab file in notepad.exe

Tyler Nguyen
Tyler Nguyen

u wot

Andrew Anderson
Andrew Anderson

Literally never going to happeen.

Aiden Smith
Aiden Smith

no one cares

stop using spaces

Hunter Robinson
Hunter Robinson

stop being a special snowflake with unreadable code

Austin Turner
Austin Turner

But a tab is a tab is a tab right? It doesn't matter how it displays on other platforms as long as it's displayed consistently

Justin Turner
Justin Turner

You realise that "using spaces" is just a setting in the editor and every usage is the very same? You press the tab key to insert 4 spaces, you press enter and the indentation is already there.

Jonathan Allen
Jonathan Allen

If you use tabs purely to indent, then you don't get any issues. But if you use tabs to align (e.g when breaking up a function call into multiple lines) then things break.

Nathan Baker
Nathan Baker

https://www.gnu.org/software/emacs/manual/html_node/emacs/Just-Spaces.html

Normally, indentation commands insert (or remove) an optimal mix of space characters and tab characters to align to the desired column.

Robert Cruz
Robert Cruz

tab indents
special snowflake
as far as i have seen, it's the most common

but that breaks portability! not all editors treat contiguous spaces as tabs!

Jordan Peterson
Jordan Peterson

Why is this still asked.
Every single IDE worth it's salt and half decent vim config sets tab to equal some number of spaces anyway.

Chase Mitchell
Chase Mitchell

we need a final solution to the indenting with spaces question

Hunter Peterson
Hunter Peterson

but that breaks portability! not all editors treat contiguous spaces as tabs!

Not all editors are created equal.

Nathan Morris
Nathan Morris

not all programmers are stupid enough to indent with spaces

Julian Bennett
Julian Bennett

At least they display spaces in the same way. Unless you use just spaces for alignment, tabs break portability even worse.

Tyler Reyes
Tyler Reyes

At least they display spaces in the same way.
not if you're using a proportional font. and by the way, your bemusement at using a proportional font to program in is equal only to my bemusement at your using spaces to indent

tabs break portability even worse
just adjust your tabstop, it's no more difficult than having to change the number of spaces spat out on pressing tab

Gavin Mitchell
Gavin Mitchell

If you're not smart enough to know how to adjust your tabstop size, you're too stupid to program in the first place. KYS.

Juan Turner
Juan Turner

spaces
If you use tabs, some faggot will have them as 56 spaces and will ruin your formatting and readability. Spaces allows the creator cashmere control on the readability of the source.

Levi Martinez
Levi Martinez

it's actually a debate of tabs vs 1 space vs 2 spaces vs 3 spaces vs 4 spaces,etc...

Juan Howard
Juan Howard

cashmere control
he can't adjust some other guy's tabs

Aaron Harris
Aaron Harris

Surely with Unicode we can create a character specifically used for indenting code?

Nicholas Flores
Nicholas Flores

So instead of the code looking aligned out of the box, I have to figure out what settings the previous author had and change my IDE for him? How about everyone just use spaces and we don't even have this fucking problem?

Gabriel Ross
Gabriel Ross

It literally already exists.
It's tabs.
Although they were not invented for this purpose, they get the job done far better than any other character.

Easton Sanchez
Easton Sanchez

indenting

Lucas Brooks
Lucas Brooks

he doesn't program with a monospaced font

Robert Flores
Robert Flores

create these vs threads on reddit, stupid children

Brandon Turner
Brandon Turner

lol 1/10

Aaron Thomas
Aaron Thomas

indentation level of 1
requires four (4) characters to achieve
why are space-fags so retarded?

Noah Kelly
Noah Kelly

Tabs are better

Gabriel Powell
Gabriel Powell

WAH I NEED TO BE ABLE TO VIEW OTHER PEOPLE'S CODE IN MY UNUSUAL WAY THAT DOESN'T CONFORM TO THE STYLE GUIDE

How to know if someone is a koder 101

William Robinson
William Robinson

At my workplace we use indentation of 5 spaces, tabs forbidden. I've been told to not even ask.

The good thing for me is I just write code however I want, and ctrl+shit+l auto-formats everything for me.

Ryan Perry
Ryan Perry

Odd indentation? It's time to leave user.

Julian Hill
Julian Hill

why press 3-5 buttons when you can press 1?

Zachary Kelly
Zachary Kelly

Over just odd indentation? Please. There are three things I dislike the the coding standard: Curly brace is on the new line, indentation is 5 spaces, and member function names are pascal-style DoThisAndDoThat() (compared to what I'd prefer, doThisAndDoThat()). Apart from those, everything's great. I even like the team. And the pay is great.

Owen Rivera
Owen Rivera

And they use non lowercase for function names in C. Two reasons to leave user. The technical chief is an incompetent code monkey.

Lucas Bell
Lucas Bell

It's C++.

Isaac Morris
Isaac Morris

Actually I even mentioned member functions. C only has function pointers, you dun goofed up, it was clear from my post I was talking about C++.

Joseph Allen
Joseph Allen

DoThisAndDoThat()
You retard it should be DoThis() and DoThat()

The bigger problem here is you're a bad software engineer.

Hunter Hernandez
Hunter Hernandez

I think you need to rethink your assumptions here.

Camden Rivera
Camden Rivera

what is soft tab

See, this is why tabfolk will always lose. They lack the curiosity of human species and are subhuman monkeys who can't even open editor settings. They are less productive, less informed, less understanding of their tools and generally dull disgusting people who likely vote far-left parties and would cause death of millions via starving if ever given power over anything more than a burned match.

Christian Diaz
Christian Diaz

Tabs, it's not the 1970s anymore no matter what the old farts and their autism say.

Eli Phillips
Eli Phillips

practice fizzbuzz and bubble sort for 72 hours straight in every language
go into interview at big prestigious tech company
anon, do a fizzbuzz on the whiteboard
I do it perfectly, gonna get the job
Got rejected: I used tabs instead of spaces

Joseph Baker
Joseph Baker

tabs instead of spaces
on a whiteboard
kek

Dominic Kelly
Dominic Kelly

Why post on Sup Forums when you've never used an editor in your life?

Gabriel Long
Gabriel Long

Spaces.
Tab is a relic of the past.

Julian Campbell
Julian Campbell

If tab characters were for indentation, they'd be called "inds", but they aren't. Tabs are for tabulation. That's why they vary in width to align to the next tabstop.

However, even using tab characters for their intended purpose of tabulation is pretty bad. You have to use a varying number of tab characters depending on the width of cells in your table. And this becomes even worse when people change their editors / terminals to use something other than the standard 8-char tabstops which changes the amount of tab characters you need between varying sized cells.

When you use tab characters for indentation, you create inconsistencies when wrapping to a fixed column width, for example wrapping comments to 80 columns. And some people who change to 2 char tabstops might end up writing much longer lines which look bad to someone who uses 8 char tabstops. The idea that tabs give different people their own choices in indentation width is a waste of time. It always can ruin formatting in certain ways using tab characters, even if you use spaces for alignment, and in any case it's still forcing the usage of tab characters upon developers just as much as a different project might force the use of four spaces. There's always going to be a prescribed style for formatting in projects so why bother?

Speaking of the whole spaces for alignment and tabs for indentation thing, this is limited in that you can't indent things after aligning things. It's pretty popular to do this in languages with lambdas such as LISP and Erlang. It also can make things like a fair bit neater and easy to see the hierarchy doing this in languages like JavaScript. However this doesn't work if you use tabs for alignment because they are variable width if they have any number of characters before them on a line which aren't all other tab characters. Besides other contributors messing up the tabs + spaces mix, it's also not nice to have to rely on listchars in vim or equivalent in normal code.

Disable AdBlock to view this page

Disable AdBlock to view this page