:: 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
Yes. 24 lines.
:: > * 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.
::
May be this plays a role, but only if you have more than 8 loops. And if you
have more than 8 loops, the performance of the outer loops becomes very
unimportant.
In 32 bit mode the pentium supports 8 bit and 32 bit. 16 bit need the
operand size prefix. This is slow.
DEC Alpha cannot handle 16 bit int's at all. The compiler generates a lot of
bit shifting and masking stuff.
--
Mit freundlichen Grüßen
Frank Klemm
eMail | [EMAIL PROTECTED] home: [EMAIL PROTECTED]
phone | +49 (3641) 64-2721 home: +49 (3641) 390545
sMail | R.-Breitscheid-Str. 43, 07747 Jena, Germany
--
MP3 ENCODER mailing list ( http://geek.rcc.se/mp3encoder/ )