I've never written code with it, but the BSDs use these macros to implement rudimentary generic types in C: <a href="http://www.openbsd.org/cgi-bin/man.cgi/OpenBSD-current/man3/LIST_EMPTY.3?query=queue&sec=3&arch=i386" rel="nofollow">http://www.openbsd.org/cgi-bin/man.cgi/OpenBSD-current/man3/...</a>. Nice.<p>However, I've only had horrible experiences trying to read the BSDs' kernel code. There are way too many statements like "mst_fqd->f_do_skb((struct mfq_t *) q);"
Linux's is very long in comparison to the BSD's. It seems to have weird edge-cases and possibly unnecessary explanations.<p><a href="https://www.kernel.org/doc/Documentation/CodingStyle" rel="nofollow">https://www.kernel.org/doc/Documentation/CodingStyle</a><p>Example: Why is the comment style different in net/? It seems to serve no obvious purpose.<p>Too many cooks :-)
The first published BSD KNF can be found various places including here: <a href="https://stuff.mit.edu/afs/athena/astaff/reference/4.4lite/usr/src/admin/style/style" rel="nofollow">https://stuff.mit.edu/afs/athena/astaff/reference/4.4lite/us...</a><p>Like the Linux kernel style, this is essentially K&R style, and the style most of Unix was written in.
I never understand the desire to omit braces in single line blocks.<p>sure<p><pre><code> for ()
foo
</code></pre>
saves you a line, but it's a bug waiting to happen.
Archaic and impractical. Example: Instead of using Linux' pragmatic approach to function prototypes:<p>"In function prototypes, include parameter names with their data types.
Although this is not required by the C language, it is preferred in Linux
because it is a simple way to add valuable information for the reader."<p>OpenBSD enforces this:<p>"Prototypes should not have variable names associated with the types; i.e.,
void function(int);
not:
void function(int a);"<p>Instead of letting the code tell the parameters' purposes, this now has to be deduced from informal descriptions, or the function definition in some .c file.