Moderators: phlip, Moderators General, Prelates

lurkersanonymous wrote:Surprised no-one has linked this yet.....
int f(int x,
......int y) {
--->return g(x,
--->.........y);
}
Phaedrus wrote:That way, everyone can view the code with the amount of indentation they prefer simply by changing the tab size.
int f(int x, int y)
{ x = g(x);
y = g(y);
return h(x, y); }#include <stdio.h>
int main()
{ struct { unsigned a:3, b:3, c:2; } n = {0};
do do printf("%hhu\n", *&n);
while(!(n.a-- && !++n.b));
while(++n.c);
return 0; } int f(int x, int y)
{>x = g(x);
->y = g(y);
->return h(x, y); }
hotaru wrote:except for those who prefer to eschew indentation in favor of alignment, like so:
- Code: Select all
int f(int x, int y)
{ x = g(x);
y = g(y);
return h(x, y); }
MHD wrote:1 press on the tab key = 4 spaces.
PERIOD!
null1024 wrote:Hard tabs suck, especially because you'd thing they were 8 actual spaces in one editor, load it up in another, and they'd be 6 or 4 visible spaces wide
null1024 wrote:and some of the lines wouldn't match.
// Tab size: 8 // Tab size: 4 // Tab size: 2
int f(int x, int f(int x, int f(int x,
......int y) { ......int y) { ......int y) {
------->return g(x, --->return g(x, ->return g(x,
------->.........y); --->.........y); ->.........y);
} } }
int f(int x, int y) int f(int x, int y) int f(int x, int y)
{------>x = g(x); {-->x = g(x); {>x = g(x);
------->y = g(y); --->y = g(y); ->y = g(y);
------->return h(x, y); } --->return h(x, y); } ->return h(x, y); }
Meaux_Pas wrote:I don't even know who the fuck this guy is
Bhelliom wrote:Don't forget that the cat probably knows EXACTLY what it is doing is is most likely just screwing with you. You know, for CAT SCIENCE!

Such as?OOPMan wrote:how much Tabs fuck everything up.
int foo(int ..bar,
........float baz) {
--->ArbitraryFunctionName(3.141,
--->......................0, 0, 0);
--->return 0;
}int foo(int ..bar,
........float baz) {
->ArbitraryFunctionName(3.141,
->......................0, 0, 0);
->return 0;
}int foo(int ..bar,
........float baz) {
------->ArbitraryFunctionName(3.141,
------->......................0, 0, 0);
------->return 0;
}OOPMan wrote:Any sane individual will go with the latter option because the former involves relying on other people, entities which can generally be shown to most likely to do the WRONG thing.
function! Tab_Or_Complete()
if col('.')>1 && strpart( getline('.'), col('.')-2, 3 ) =~ '^\w'
return "\<C-N>"
else
return "\<Tab>"
endif
endfunction
:inoremap <Tab> <C-R>=Tab_Or_Complete()<CR>
achan1058 wrote:Spaces, since I don't want my code to be indented 8 space because I loaded it into notepad, or at places where I can't change the tab indentation.
achan1058 wrote:Except that you might be using a Thin Client that does not have workable USB, not does it allow you to run random programs. (Though I personally try to stay away from doing anything more than e-mail with those things.)

and still be wrong, since you can retab everything just like you can respace everything.I've got to say the only way to ensure a measurable amount of readability is to banish all space characters. At least with tabs it's always consistent. The number of files I found with mixed tab/space indenting was huge, and my general fix was to reindent entire source files using tabs only. Problem solved.
lulzfish wrote:Tabs use ONE character to represent ONE logical entity: A [single level of] indentation.
Spaces use [a variable number of] characters and require the use of adjustment macros just to change the indent size.
It's like using a package manager... automating the problem instead of fixing it.
Pesto wrote:I hate when I hit the tab key one too many times and I have to hit the backspace key four times to undo it.
phlip wrote:Ha HA! Recycled emacs jokes.
Users browsing this forum: No registered users and 1 guest