basepi / libgit2

The Library
http://libgit2.github.com
Other
0 stars 0 forks source link

extraneous spaces in libdiff.c #31

Open trane opened 13 years ago

trane commented 13 years ago

There are some places where spaces should be tabs in libdiff.c. Anytime there are 4 spaces, that can be a tab, even if those 4 spaces are for lining things up. If there are 6 spaces, four of them should be 1 tab and the other 2 just spaces. I can fix it if you want.

hausdorf commented 13 years ago

Sure. Generally if there are spaces, it's because it's really someone else's code.

hausdorf commented 13 years ago

Actually, no. You use spaces whenever you want two lines to line up, and you often use more than for spaces do to it. In this example, you indent both the first and the second line with 1 tab, and then use spaces to line up the xdl_change_compact() calls.

I propose that our solution is fine.

Also, this should be (and is) integrated into #22

trane commented 13 years ago

6 spaces = 4 spaces + 2 spaces = 1 tab + 2 space. Right?

hausdorf commented 13 years ago

Not everyone displays it as 4 spaces though.

trane commented 13 years ago

That is why spaces > tabs. In the case that people don't use 4 spaces for tabs, and there is a tab somewhere that they set as 2, then your 6 spaces would be way off, as opposed to tab + 2 spaces, as the tab scales to the number of spaces they want tab to scale to, where your spaces don't scale at all.

hausdorf commented 13 years ago

Hey man, I didn't choose the style.

trane commented 13 years ago

It makes me wonder what they were smoking. The only way to make tabs make sense, is if you use them for everything and don't use spaces for lining up at all. That would sometimes result in something like this...(since they don't use monospaced fonts it still looks a little off)

int fake_func(  argument1,
                 argument2);
vimalloc commented 13 years ago

I agree there trane here, but hey what do you do.

hausdorf commented 13 years ago

Huh. Makes sense to me.