Well, Jow Forums? Tabs or spaces?

well, Jow Forums? Tabs or spaces?

Attached: tabs-vs-spaces.png (600x272, 109K)

Other urls found in this thread:

supportline.microfocus.com/documentation/books/sx50/lhintr.htm
en.wikibooks.org/wiki/Fortran/Beginning_Fortran#Example_Code
twitter.com/SFWRedditGifs

Tabs
Except for fucking YAML

why the fuck would you use only tabs
for(i = 1; i

...

Mongolian vowel separators

kek'd

Tabs. Anyone who uses less than an 8-character tab needs to have their hands removed.

Tabs, but automatically converted in spaces

for(i=1;i

I use tabs for variable indents & spaces elsewhere. I also tend to use industry standards (e.g. spaces-only for js/python/ruby).

for(i=1;i

Tabs for indentation, spaces for alignment.
Literally the best of both worlds.

>alignment

Attached: soyboy.png (644x800, 15K)

>i=1
>i

Attached: 1530478434803.png (354x407, 114K)

Literally nothing wrong if you want to be using the numbers 1 to 5 in the loop.

it's good practise to start with i=0 as that's where arrays start

it's good practice to use the right tool for the job, how do you know i was to be used to access an array?

Vim literally converts tabs into spaces for me, I can specify how too.

I said it was good practise, ie you should do it even when not in the context for why it's useful. That way, you reduce the chance of mistakes and maintain consistency, as right now you'll be defining i as 0 when dealing with arrays and 1 the rest of the time. It's better to always use one, and defining i as 0 is the one that makes an actual difference.

i can smell the needful coming right off of you

Tabs

What if I know I want to loop through values 1 to 5 in the array?
What if I am not using an array but I want the values 1 to 5?

If you want your loop to start from 0, start from 0.
If you want it to start from 1, then start from 1.
If you want it to start from 100, then start from 100.
Use whatever values fit what you're doing.

>66572260
always two spaces, no tabs. makes it consistent for whoever views it in whatever editor or browser.

also, horizontal space is precious

i use 2 spaces instead of tabs even in python

vim:
set shiftwidth=2
set tabstop=2
set softtabstop=2

>What if I know I want to loop through values 1 to 5 in the array?
>What if I am not using an array but I want the values 1 to 5?

I know you're not doing either of these because you posted a single line of example code to make a point about tabs, there's no wider program that requires you to do any of that, just a single line of code that you wrote with bad practise. Own up to it, faggot.

No.

Bossman says to use spaces, so I use spaces. Personally, I don't have a preference. The most important thing is that everyone follows the same conventions.

Whatever the common convention is.

I don't care, as long as you use tabs correctly, ie. to mean advancing the cursor to the next column number divisible by eight. Otherwise, your code is non-standard and bad and won't show up correctly in correct editors.

Attached: unix-2.png (525x171, 41K)

This looks really good

>horizontal space is precious
What the fuck are you coding on? For me it's only the vertical space that is precious.

Don't care as long as it is consistent.

Attached: 1301539848889.gif (646x812, 10K)

Not him, but I agree. It's not that you literally run out of horizontal space, but keeping things reasonably close together makes them much easier to read simply due to being able to watch more things at once.

tabs the size of one space

Both.

>be me
>tabs all my life
>working with vim usually
>switch to IDE for school project and write with vim plugin
>after finishing disable the plugin so the guy can check it and I won't look like an elitist fag forcing vim on others
>wrote the whole project with spaces and didn't even know it
This is when I realized it doesn't matter which you use because text editors with command based navigation abstract it for you.
Use the convention user.

I don't use spaces for anything, ever. I just make my lines of code very short.

depends

>indentation at all

nice bloat.

>use the needful user

No you're being stupid.
If you want an integer ranging [1,5] you write just that.
You dont write [0,4] and increment at the usage site.

You can't have programmed more than a day or two if you don't see this as obvious.

Only use tabs. Tab is characters wide, anything else makes you faggot.
void fn( int arg0,
int arg1);
{
}

>write some beautiful kode
>using tabs
>upload to github
>alignment ruined
>looks like shit
>switch to spaces

Spaces because tab stops are not standardized and disk space hasn't mattered in decades.

Yes.

Tabs that autoconvert to spaces

>2 spaces = one level of indentation
>3 spaces = one level of indentation
>4 spaces = one or two levels of indentation
vs.
>1 tab = one level of indentation
>2 tabs = two levels of indentation
>3 tabs = three levels of indentation

Your editor of choice can display a tab as however many columns your eyes prefer.
>i want 4 columns per level, but you prefer 2
>we both use tabs and we both get what we want

Irony being that your average "unix" user these days are the ones who obviously need money for a better computer.

tabs for indentation
spaces for alignment

>upload to github
>alignment ruined
This only happens if you aren't using 8 space tabs.

Should be tabs, so a single level of indentation corresponds to one tab, rendered however you like by your IDE. But occasionally you get function definitions or invocations with lots and lots of arguments split across several lines. Making that look nice requires you to newline and move things by one or two spaces. So spaces.

good one, big dick mike.

Attached: the-indian-programmer-starter-pack-does-i-wsr-leave-it-26270725.png (500x622, 99K)

>implying that that for cycle will be used on an array

Attached: 0cc.jpg (633x640, 47K)

The only correct answer

My coworker is fucking weirdo. This is how he writes C++. I wish I were joking. Regardless of your opinion on tabs or spaces, I think we can agree that this is an abomination.

#include

int
main
( int
argc,
const char
**argv ) {
std::cout

looks like he must have grown up on COBOL or FORTRAN?

The fuck

>mfw 8 space tabs

you are missing a tab between "for" & "("

He is an old fart, I'll have to ask.

Tabs because they waste fewer bytes, can be user configured, take one keystroke and work everywhere.

Spaces are idiotic.

Even in a fixed-form COBOL or Fortran program, you're always placing the name and data type of a variable on the same line.
supportline.microfocus.com/documentation/books/sx50/lhintr.htm
en.wikibooks.org/wiki/Fortran/Beginning_Fortran#Example_Code

>correct editor
Doesn't exist, your opinion is disregarded

Maybe he is writing code on the phone.

I suspect he might've been working in BASIC too much.

Meaning an editor that complies with the ASCII standard.