Wich indent style do you use?
category: general [glöplog]
thec: that's only true if you only use tabs. However, often people will be using a combination of tabs and spaces, and that's where the problems start :-)
well, you should always tab in to your depth, and space to fill out for multi line code... that way it doesn't matter since you originally have n tabs, and n+s spaces on the following rows...
I'd say the problem is that many coders want spaces instead of tabs, because they think that's the only way to make sure the code looks the same everywhere, which is like I said, not needed.
I'd say the problem is that many coders want spaces instead of tabs, because they think that's the only way to make sure the code looks the same everywhere, which is like I said, not needed.
thec: ok, but I understand that you then don't use tabs to align variable names in declarations? Like f.e. "<tab>int<tab>i;"
10 PRINT "I AM A 1337 CODER++ AND I SHIT ON INDENT"
20 GOTO 10
20 GOTO 10
I for one, do also the space before bracket after function call thing. Weird me.
Code:
Maybe<Commands::Command> currentCommand;
while (NOTHING != (currentCommand = commandBuffer.readNext ())) {
if (Commands::FLASH == currentCommand.value().destination) {
flashAt = f;
font->draw ("cunt");
} else if (Commands::SPAWN == currentCommand.value().destination) {
tick->rearm ();
font->draw ("bitch");
}
}
I'm not sure I understand the question, I usually have a big main(), about 5000 lines long, without indent :)
Does it contain gotos as well? :)
Plenty! :)
sparcus: of course, intendation with tabs can only be done in the start of a line...
hmmm this is the only piece of code i can find done by me (1995? 1996?)
=)
Code:
program mosquito;
uses crt,dos;
var dat :text;
procedure autoexec;
begin {of autoexec}
assign(dat,'autoexec.bat');
append(dat);
writeln(dat,'MOSQUITO');
end;
begin {of main}
autoexec;
sound(5000);
end.
=)
tabs are useful for editing aligned lines without much effort. i'd prefer to use 4 space width tabs and never encountered other than that and 8. I'd rather specify tab width at the beginning of the document than senselessly adding billions of spaces. especially if you have many nearly identical lines, like class constructor or data arrays or unrolled loops.
and i also hate one specific style of indenting. that is adding the first argument after function declaration-definition and listing others at new lines padded with lots of space to align with the first. like the code glade generates. i'm so pissed of the style that i won't try to give an example.
and imo discussing indentation is a bit senseless than discussing styles of charts, like flowcharts, class relation diagrams or system graphs. they also tend to reveal design approaches and eliminates the pain of reading code. though it seems noone bothers using these unless they have to because of their work :)
and i also hate one specific style of indenting. that is adding the first argument after function declaration-definition and listing others at new lines padded with lots of space to align with the first. like the code glade generates. i'm so pissed of the style that i won't try to give an example.
and imo discussing indentation is a bit senseless than discussing styles of charts, like flowcharts, class relation diagrams or system graphs. they also tend to reveal design approaches and eliminates the pain of reading code. though it seems noone bothers using these unless they have to because of their work :)
is this really a pouet thread?
omg turbo pascal!
i forgot
I used to use one space, until the people at work started throwing stuff at me whenever I committed stuff. It's 4 spaces all the way now :(
someone had to do it.
I use the second method. I did so even in Pascal years ago.
The above means that in vim, I use 4-space tabs and syntax highlighting.
Code:
mot@bones:~$ cat ~/.vimrc
:set ts=4
:syntax enable
The above means that in vim, I use 4-space tabs and syntax highlighting.
c-jump WTF!
my lines are very long so I use no indent style whatsoever.
I love the idea of that c-jump game!
"Ages: 11+" - seems about adequate, though some younger ones will certainly also be interested.
"Ages: 11+" - seems about adequate, though some younger ones will certainly also be interested.
i write in the style of anesthetic but using tabs instead of four spaces or whatever. when i used to write in edit i used spaces though, because the tabs were too long.
Adok: 11+ or mensan babies.
Zest: I guess I'll buy such a toy for my future kids. =)