lkml.org 
[lkml]   [2001]   [Jan]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [OT?] Coding Style
Admin Mailing Lists wrote:
> hand-holding of that magnitude. We don't write code for idiots.

But if you have to, you can at least enjoy it:
- diversity makes life interesting: use switch() with local variables or
without curly braces
- de-referencing is like a hotel: the more stars, the better
- observe proper punctuation: use the comma operator frequently
- know thy C: few people know that 5[x] is valid, but they can usually
guess what it does. They probably won't get x[5[y]], though.
- know thy CPP: nest macros and exercise token-concatenation and
stingification
- if your code allows you to, put #define while if in some header file

- Werner (couldn't resist ;-)

--
_________________________________________________________________________
/ Werner Almesberger, ICA, EPFL, CH Werner.Almesberger@epfl.ch /
/_IN_N_032__Tel_+41_21_693_6621__Fax_+41_21_693_6610_____________________/
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/
\
 
 \ /
  Last update: 2005-03-22 13:17    [from the cache]
©2003-2011 Jasper Spaans