[Ffmpeg-devel] [PATCH] video4linux2 input
Tue Feb 7 11:22:51 CET 2006
On Mon, 2006-02-06 at 12:06 -0500, Rich Felker wrote:
> > To be even more elegant, I'd use a enum AND a table. #define's for
> > constants are evil, indeed.
> Do you have any good reason to say this or is it just more CS dogma?
Tables: less executable code -> less maintenance and bugs, if one entry
works, all work.
#defines: using #define for constants is reducing the C compiler to a
super-assembler. If someone likes to program assembler, one should
actually use the assembler and not misuse cpp for that purpose. C does
have a notion of types (although not strongly enforced -- a shame) and
using #defines you're totally defeating any sense of types. Also, if
used heavily, the code is really difficult to debug, gcc -E output is
My $0.02 on flames ;-)
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 2771 bytes
Desc: not available
More information about the ffmpeg-devel