Okay, just curious again: How many spaces do you indent? I indent 4 spaces. I think 4 will be the majority.
Printable View
Okay, just curious again: How many spaces do you indent? I indent 4 spaces. I think 4 will be the majority.
Tab.
never tab unless you have tabs set to insert spaces.
Well, how much does the tab indent in your editor?
You know, I agree. Tabs can really mess up your indentation. But everyone seems to use them.Quote:
never tab unless you have tabs set to insert spaces.
I let Dev-C++ indent for me, unless an if statement indents too far, then I set it to about 7. Otherwise, it's 4 or 5. So I selected all three options above. :p
If you can manage not to mix the two, tabs are fine. 2 or 3 spaces are not enough. Use 4 or more.Quote:
never tab unless you have tabs set to insert spaces.
You guys are weird. I ALWAYS indent 4 spaces.
My experience doesn't justify this statement. In my opinion, 1 is too little, but 2 is enough if the code is formatted consistently. 4 can easily be too much with some styles of C and most styles of C++ where lines can get pretty long, and the indention doesn't help.Quote:
2 or 3 spaces are not enough. Use 4 or more.
Does anyone actually indent 1 space?
I know Govtcheez voted for everything, but I doubt he uses 1 space. Well, maybe.
I do a tab, whyd does a tab screw things up?
Well, if you transfer it, it sometimes ends up looking like this:
Code:int main(void) {
if(1) {
printf("hi");
}
return 0;
}
Yup. I use 2. 4 is too much; especially if you have to keep it under 80 char per line, those indents add up quickly.
If they "add up quickly", modularize your program (ie, break it up into functions). One of my books suggests that you shouldn't go over three levels of indentation, but I don't go that far.
But I think 8 is too much, for all that.
If your lines are too long it's not the tab size that is the problem.