[Ffmpeg-devel] [PATCH] video4linux2 input

Erik Slagter erik
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
not pretty. 

My $0.02 on flames ;-)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 2771 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20060207/3634c3d1/attachment.bin>



More information about the ffmpeg-devel mailing list