Which do you prefer in your code?
Personally I like tabs more but they're misused for formatting instead of indentation by many which is annoying and kind of defeats the purpose.
Tabs are `4' spaces, so I am not sure what the question is.
Name:
Anonymous2009-03-10 23:04
My tabs make spaces.
Name:
Anonymous2009-03-10 23:07
tabs are waaaay better the spaces for code. 4-8 key presses to indent/un-indent vs 1 key press. Any good editor has options to set how long the tabs are, so you can set any tabbed code to your liking(even you, 3 spacer).
>>1
I used to be in the "tabs for indentation, spaces for formatting" camp, until I realized that I spent too much time worrying about whether my editor was inserting tabs or spaces in the places I wanted, so I switched to spaces-only.
I use python and vim with 'set list' (shows special characters such as tabs) and tab-size set to 7. Thus if I indent, say, a line with 'if something:' by seven spaces and the next lines with the if-block contents by one tab, python understands the indentation (since it thinks tab is 8 spaces), while I have nicely aligned code with dark blue '>' characters (set by 'listchars') showing me which code is 'indented'.
>>26
That's not even K&R, because K&R still put functions' braces on separate lines.
#include <stdio.h>
#include <string.h>
int main(int argc, char *argv[])
{ // <-- THIS IS ALWAYS THE RIGHT WAY, FAGGOTS.
int i;
size_t arg_len;
for(i = 0, arg_len = 0; i < argc; ++i) { // <-- THIS IS OK.
printf("%i: %s\n", i, argv[i]);
arg_len += strlen(argv[i]);
}
printf("Length of arguments: %zu\n", arg_len);
return 0;
}
Name:
Anonymous2009-03-11 14:23
VS vs vs
Which do you prefer in your code?
Personally I like vs more but they're misused for comparison instead of contrast by many which is annoying and kind of defeats the purpose.
>>27 THIS IS OK.
You're a flaming faggot, that's what I think. Do you really enjoy two closing and a single opening paren on the left side of your code? Woah, that's beyond me. No, seriously, doesn't it bother you that the function parens are lined up, but the loop ones are not?
Name:
FrozenVoid2009-03-11 14:56
#include <stdio.h>
#include <string.h>
int main(int argc, char *argv[]){int i;size_t arg_len;for(i=0,arg_len=0;i<argc;++i){
printf("%i: %s\n",i,argv[i]);arg_len+= strlen(argv[i]);}printf("Length of arguments: %zu\n",arg_len);return 0;}
___________________________________________
If there is no struggle, there is no progress.
Name:
Anonymous2009-03-11 14:57
This is a stupid thread.
Name:
Anonymous2009-03-11 15:35
>>29
Parens? Do you mean braces? And if so, please clarify what you mean. I actually prefer the BSD/Allman style, but I've occasionally used K&R, but only in C code: for C++, C#, Java, or any other braces language, I use BSD style.
Name:
Anonymous2009-03-11 15:36
>>26
Bashing my indentation style seriously offends me. Please stop.