[MPlayer-dev-eng] c++ version of mplayer.c

D Richard Felker III dalias at aerifal.cx
Thu Feb 10 14:45:51 CET 2005


On Thu, Feb 10, 2005 at 10:46:15AM +0100, Attila Kinali wrote:
> Moin,
> 
> On Thu, 10 Feb 2005 10:28:57 +0100
> Moritz Bunkus <moritz at bunkus.org> wrote:
> 
> > > (have C++ coders ever heard about Turing for example? you can do
> > > everything in C too, hey)
> > 
> > Then why not code everything in Assembly? Or do a "cat > mplayer" and
> > enter opcodes by hand. It's about chosing the right tool for the
> > job. For MPlayer, C++ isn't the right tool, but for a lot of other cases
> > it is (or C is at least a major inconvenience).
> 
> I wouldn't say C++ is the wrong tool for MPlayer. We are already
> doing quite a lot of object oriented programming within MPlayer
> (just think about all the [av][of] modules).

C++ is the wrong tool for anything because:
1) Among object-oriented languages, it's a BAD one.
2) An object-oriented language is actually not any good for coding
with _useful_ object-oriented methods. It just encourages you to do
stupid stuff for dogmatic purposes to make things slow and bloated,
rather than taking advantage of the few positive points of oo.

> And no, it's not true that C++ has to be slower than C, it
> just depends on how well you are able to write C++ and

Obviously if your C++ code is the same as the C code (albeit with
thousands of idiotic explicit casts put in to silence warnings) then
the C++ version won't be much slower. If you actually use C++'s
(mis)features for the significant work of your program, it WILL be
significantly slower.

> how well you know what kind of code is produced.
> It's just that C programmers think it has to be slower because
> it does more.

ROTFL!

> > > I think C++ people are somewhat snobbish, at least I see everywhere
> > > that that want to rewrite everything in C++ which works good in C for
> > > ages ...
> > 
> > And C coders are elitist in that they think that every language other
> > than C sucks big time. So what else is new?
> 
> Full ACK.

Yes, because every other language that appears sucks. Some suck less,
like ocaml or python or lua, but all the others have their very
specialized purpose and target user base. C is far from ideal, but
it's the only language suitable for general-purpose application
writing. Yes it would be possible to design a better language, but it
would be so similar to C that it would be a huge waste of time and
effort to convert everything over, so why bother?

Rich




More information about the MPlayer-dev-eng mailing list