| then how do people think about this one:
http://www.kernel.org/doc/Documentation/CodingStyle
Tabs should be 8 characters because that's how they have been for ages.
Most display mechanisms that handle tabs work this way. However, there is
no basis for that to conclude that indentation of code must be 8. It can
be 8, and that makes files a bit smaller. Are small source files important?
I don't think so. Consistency is. Pick an indentation and use it uniformly.
I don't think 3 levels of indentation means you are screwed. And the limit
on 80 columns is completely outdated. I'm using a 142 column display. Any
that can't use at least 120 columns is still using old technology. Upgrade.
80 columns is for punch cards.
Interestingly, they use exactly the same "inconsistency" I use for placement
of brances (next line for functions, end of line for all else).
I do use a space after _operator_ keywords like sizeof. The reason for that
is that sizeof itself does not require parenthesis. You can put a variable
name without parenthesis right after sizeof and it is valid. Type keywords
do need parenthesis. When I have parenthesis around something to enclose,
I have a whitespace (it can be a tab where applicable) before the start.
I usually put spaces after unary operators. In many cases not doing so makes
them hard to read. In particular, the & symbol looks like a letter. I did
originate as a letter in Old English.
I like the naming strategy. Names with smaller scope of usage should be
shorter. Names with a wide scope of usage should be longer.
WhatIHateTheMostIsUsingCapitalizationAsSeparationAndJammingWordsTogether.
I like the typedef rules. Accessor functions/macros for struct members has
to be judged in terms of whether they are just defeating opacity, or provide
something useful. The former should be avoided.
I usually separate functions in one source file with TWO blank lines.
I use gotos for common error cleanup the same way.
I disagree on comments. I think they should explain HOW things work, too,
even if it is obvious (and it's good if it is obvious). Confirming that
the code is written as intended is good. I also do like the C99 // style
comments because in most cases I find them easier to read.
I might try their .emacs setup.
What they call CAPITALIZED is actually UPPER CASE. Capitalizing Just Makes
The First Letter Upper Case.
Years ago I got burned by gcc's mishandling of inline functions and started
to use macros instead. I got good with macros. But I guess I should move
at least some of them back to inline functions, as it appears that gcc has
resolved the issues. But this is when inline is good usage. There is a lot
of cases where it is not, as this document points out.
BTW, that mishandling was a size limitation that was way too small. I have
heard that since gcc 4, this is fixed. I'll try that some day.