[FFmpeg-devel] *** GMX Spamverdacht *** Re: [PATCH] doc/examples/muxing: make compatible with C++

Michael Niedermayer michaelni at gmx.at
Fri Mar 14 17:59:11 CET 2014


On Fri, Mar 14, 2014 at 05:23:52PM +0100, Nicolas George wrote:
> Le quartidi 24 ventôse, an CCXXII, Michael Niedermayer a écrit :
> > People who want to use ffmpeg from C++ need examples which work in
> > C++.
> 
> People who want to use ffmpeg from INTERCAL need examples that work in
> INTERCAL, shall we make the examples INTERCAL-compatible too?

if you can do it by changing 6 lines in the example and theres a
significnat userbase, why not ?

but i suspect neither is true for INTERCAL


> 
> INTERCAL is a ridiculous example, but the same applies to all languages that
> are actually used, including java and PHP.

same here, if we could make our examples be useable & valid for these
by changing 6 lines and theres a significnat userbase ...
java and PHP have a significnat user base but i dont think a long
piece of C code would magically turn into PHP or java by chnaging
6 lines


> 
> The casts you added are necessary in c++ but they are bad practice in C.
> That makes the example weaker, as it no longer shows the best practices.

We could add a comment that clarifies that the casts are bad practice
in C but needed to support C++


> 
> There are certainly dozens of tutorials on how to get C code to build as
> c++, explaining just what you did with the examples. And actually, this is
> basic programming skill: someone who does not have it should probably not
> try something as hard as multimedia processing yet.


> 
> I am not against a pure c++ example, but making the C examples less readable
> and getting them to show bad practice is IMHO a very bad idea.

do you volunteer to maintain a seperate set of
examples for C++.
I would have thought that having the same example code usable for
both languages would be the overall better solution

but iam happy with anything people prefer, the only thing that iam
not happy about is if the average C++ programmer cant use the examples
and that then is only because of 6 lines of code and some
philosophical reasons

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Opposition brings concord. Out of discord comes the fairest harmony.
-- Heraclitus
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20140314/d5393727/attachment.asc>


More information about the ffmpeg-devel mailing list