Frank Klemm schrieb am Fre, 01 Sep 2000:
> lame/CODING_STYLE, version 0.001 ;-)
> ---------------------------------------------------------------------
> This is the first try of a Coding Style:
notes on some points
> * Don't use tabulators (the character with the value '\t') in source code,
> especially these with a width of unequal 8. Lame sources are using
> different sizes for tabulators.
I don't like tabulators too
> * Functions should be not longer than 50 lines of code.
this is debateable
> Every function should only do ONE thing, and this should
> be done well.
every proggi thinks his functions are doing well, until he finds
out the flaws he introduced.
> * Document functions.
programmers don't document, you know ;-)
OK, your point is clear and I'll try to add more comments
(hopefully useful remarks..)
> * Don't use single 'short' variables to save storage.
> Short variables are especially on Pentium Class Computer much slower than
> int's. DEC alpha also hates short variables.
>
> Example: float bla [1024];
> short i;
> for ( i = 0; i < 1024; i++ )
> bla [i] = i;
I'm not so sure about shorts. Documents on the Intel compiler suggest
for example to put the index variables of nested loops in a struct
to improve cache performance, this way they would be in the same cache line.
Ciao Robert
--
MP3 ENCODER mailing list ( http://geek.rcc.se/mp3encoder/ )