If you write i=i++, your computer can teleport itself to 16th century Wittenberg and change Western history by nailing sections 1.6 and 3.3 of ANSI X3.159 to the church door.
>>6
I tried that and it didn't work, where do I file a compiler bug?
Name:
Anonymous2010-03-03 7:23
INDENTATE MY ANUS
Name:
Anonymous2010-03-03 8:21
>>1 http://en.wikipedia.org/wiki/Indentation
i disagree, sheeple. indentation is bloat and a good programmer will tokenize and compile the program in his mind. most c and javascript functions can be successfully be written in four or less lines and it conserves screen real estate. to maximize it i also dont use monospaced font and have #defined many common patterns to one or two letter abbreviations. when you write your post do you indent. no because a program tells a story that should be understood without indention.
_________________________________
orbis terrum delunda est
Like the Allman and Whitesmiths styles, GNU style puts braces on a line by themselves, indented by 2 spaces, except when opening a function definition, where they are not indented[5]. In either case, the contained code is indented by 2 spaces from the braces.
Popularised by Richard Stallman, the layout may be influenced by his background of writing Lisp code. In Lisp the equivalent to a block (a progn) is a first class data entity and giving it its own indent level helps to emphasize that, whereas in C a block is just syntax. Although not directly related to indentation, GNU coding style also includes a space before the bracketed list of arguments to a function.
>>13
I guess that's why GNU style goes:
int main (int argc, char **argv) {
int i;
for (i = 0; i < argc; i++) {
puts(argv[i]);}}
Somebody ought to do something about the retarded comparison to Lisp code.
Name:
Anonymous2010-03-03 17:18
8-space tab width K&R style on an 80x24 terminal is, truthfully, the only way to go.
The restricted space helps you put extra thought into not usingExtraVerboseCamelCaseVariables and designing your program such that it is efficient and compact whilst maintaining readability.
Name:
Anonymous2010-03-03 17:34
>>17
I'm partial to 2-space indentation actually. The first company I worked at did it this way and I ended up really liking it.
Also, the tab character should burn in hell. Spaces are the only way.
>>17
8-space tabs make it harder for your eyes to take in a block of code all at one go.
For a while I used 4-space tabs, but my code host displayed them as 8-space, fucking up the formatting. I finally converted to 2 space indentation (with actual spaces) to follow a project's coding standard, and haven't looked back.
Name:
Anonymous2010-03-03 17:54
4-space tabs works fine for me.
2-space looks messy.
Name:
Anonymous2010-03-03 18:04
We know code gets indented but what is an appropriate way to indent newline comments?
Name:
Anonymous2010-03-03 18:08
wow ppl try to troll over how many spaces a tab character should have..
>>24 >>18 here, I usually set the tab character to take 13 spaces so that the evil tab characters stand out. I also like that my svn/git diffs use 8 spaces for tabs so I can see them there too.
Name:
Anonymous2010-03-03 18:41
I actually use inverse identation, making the first statements at least 20 spaces ahead and decreasing that value.
If your indentation gets fucked up after changing the tab width you're using tabs wrong.
Makes using them kind of pointless if you can't even change their width, don't you think? What's the point?