Why was VLC written in C and not C++?

Just have a drink and chat
MetalheadGautham
Big Cone-huna
Big Cone-huna
Posts: 720
Joined: 25 Apr 2007 23:11
VLC version: 0.9 series
Operating System: ArchLinux i686
Location: well....... there is a door in front of my house
Contact:

Why was VLC written in C and not C++?

Postby MetalheadGautham » 31 May 2007 11:55

I have looked all over the website, but got no answer on this one.

I mean, isn't C++ much more feature rich that C?
Visit: VLC and Other alternatives to Popular Media Players
Website: thesmallerbang.wordpress.com
On Linux, blindly use VLC, SMPlayer, Kaffeine, GXine, Totem and MPlayer
Image
PM requests to attend to problems will not be entertained
Please post your question in the RIGHT forum.
SEARCH before posting to see if your question's been already answered

Jean-Baptiste Kempf
Site Administrator
Site Administrator
Posts: 37523
Joined: 22 Jul 2005 15:29
VLC version: 4.0.0-git
Operating System: Linux, Windows, Mac
Location: Cone, France
Contact:

Postby Jean-Baptiste Kempf » 31 May 2007 12:01

Well, yes, but C is faster for many tasks and more supported in many platforms.
Jean-Baptiste Kempf
http://www.jbkempf.com/ - http://www.jbkempf.com/blog/category/Videolan
VLC media player developer, VideoLAN President and Sites administrator
If you want an answer to your question, just be specific and precise. Don't use Private Messages.

MetalheadGautham
Big Cone-huna
Big Cone-huna
Posts: 720
Joined: 25 Apr 2007 23:11
VLC version: 0.9 series
Operating System: ArchLinux i686
Location: well....... there is a door in front of my house
Contact:

Postby MetalheadGautham » 31 May 2007 12:14

how? when I learnt C, I noticed that to display my name, all I had to type were around five lines, but for C++ it takes a page, but for large programs isn't C++ supposed to be better? OOP is supposed to reduce size isn't it?


or are you just using C because it is easier to learn, with only 28 keywords?
Visit: VLC and Other alternatives to Popular Media Players
Website: thesmallerbang.wordpress.com
On Linux, blindly use VLC, SMPlayer, Kaffeine, GXine, Totem and MPlayer
Image
PM requests to attend to problems will not be entertained
Please post your question in the RIGHT forum.
SEARCH before posting to see if your question's been already answered

Jean-Baptiste Kempf
Site Administrator
Site Administrator
Posts: 37523
Joined: 22 Jul 2005 15:29
VLC version: 4.0.0-git
Operating System: Linux, Windows, Mac
Location: Cone, France
Contact:

Postby Jean-Baptiste Kempf » 31 May 2007 13:24

Why is Linux kernel in C and not in C++ ?
Jean-Baptiste Kempf
http://www.jbkempf.com/ - http://www.jbkempf.com/blog/category/Videolan
VLC media player developer, VideoLAN President and Sites administrator
If you want an answer to your question, just be specific and precise. Don't use Private Messages.

ipkiss
Big Cone-huna
Big Cone-huna
Posts: 695
Joined: 23 Nov 2003 01:49

Postby ipkiss » 31 May 2007 13:28

Interesting troll, let's feed it :)
how? when I learnt C, I noticed that to display my name, all I had to type were around five lines, but for C++ it takes a page,
Hum... You probably didn't learn C++ at the same time then, because you really don't need more lines in C++ then in C for such a task :-)
but for large programs isn't C++ supposed to be better? OOP is supposed to reduce size isn't it?
Size does not matter ;-)
In fact, OOP is essentially a different way to structure the code, grouping data with the functions which manipulate this data. The central notion is the one of encapsulation, which in turns often allow reusability and less code, but the size of the source code is not the direct aim of OOP (in fact, it may even be more verbose in some cases).
or are you just using C because it is easier to learn, with only 28 keywords?
C is probably easier to learn (and often constitute a first step before learning C++), but the number of keywords has nothing to do with that.
Well, yes, but C is faster for many tasks and more supported in many platforms.
That's not really true. Well-written C++ is as fast as C, and nowadays C++ is supported on a lot of platforms (all the ones supported by g++ in particular). One can argue that the compilers do not support all the features of the languages, but it only concerns "rare" features, used only in a few very specific programs.
I think that the main reasons why most of VLC is in C are the following:
- the first developers knew C very well, but not C++, so naturally started using C
- at that time, C++ was indeed less spread, and many compilers didn't support properly many features of the language (templates in particular)
- C++ ABI is much less well-defined and stable than C one, so the modules mechanism as it is now in VLC would be more tricky to do in C++ (if even possible)
- VLC core, written in C, has a nice design which "emulates" the notion of encapsulation; so some of the advantages of C++ are there (of course, other advantages like the STL are still missing).
- rewriting everything in C++ now would be a colossal task that nobody is ready to do

Note also that some modules of VLC are written in C++.

Jean-Baptiste Kempf
Site Administrator
Site Administrator
Posts: 37523
Joined: 22 Jul 2005 15:29
VLC version: 4.0.0-git
Operating System: Linux, Windows, Mac
Location: Cone, France
Contact:

Postby Jean-Baptiste Kempf » 31 May 2007 13:53

:'( Well, someone at least took your question seriously at least, Metal.

Just for your information, skins and Qt4 are in C++
Jean-Baptiste Kempf
http://www.jbkempf.com/ - http://www.jbkempf.com/blog/category/Videolan
VLC media player developer, VideoLAN President and Sites administrator
If you want an answer to your question, just be specific and precise. Don't use Private Messages.

MetalheadGautham
Big Cone-huna
Big Cone-huna
Posts: 720
Joined: 25 Apr 2007 23:11
VLC version: 0.9 series
Operating System: ArchLinux i686
Location: well....... there is a door in front of my house
Contact:

Postby MetalheadGautham » 01 Jun 2007 04:43

:'( Well, someone at least took your question seriously at least, Metal.

Just for your information, skins and Qt4 are in C++
well it was not one of my useless questions I can assure you that. I asked this because of curiosity and intrest to relearn C and/or C++ which I learnt way back just after elementary schooling, but forgot due to lack of use and lack of presence of a comp in my house at that time...

and I think this makes a good thing to add to the FAQ.
Visit: VLC and Other alternatives to Popular Media Players
Website: thesmallerbang.wordpress.com
On Linux, blindly use VLC, SMPlayer, Kaffeine, GXine, Totem and MPlayer
Image
PM requests to attend to problems will not be entertained
Please post your question in the RIGHT forum.
SEARCH before posting to see if your question's been already answered

Jean-Baptiste Kempf
Site Administrator
Site Administrator
Posts: 37523
Joined: 22 Jul 2005 15:29
VLC version: 4.0.0-git
Operating System: Linux, Windows, Mac
Location: Cone, France
Contact:

Postby Jean-Baptiste Kempf » 01 Jun 2007 10:20

and I think this makes a good thing to add to the FAQ.
Add it :D
Jean-Baptiste Kempf
http://www.jbkempf.com/ - http://www.jbkempf.com/blog/category/Videolan
VLC media player developer, VideoLAN President and Sites administrator
If you want an answer to your question, just be specific and precise. Don't use Private Messages.

DJ
Cone Master
Cone Master
Posts: 8206
Joined: 01 Jan 2006 04:30
Location: Koloa, Hawaii USA

Postby DJ » 01 Jun 2007 11:45

Oh! Oh!

Now you know, as long as he keeps sitting in that Electric Chair he is frying more BRAIN CELLS and forgetting more than he will ever remember, thinking about how wonderful it is! :roll: Drugs do that too.

CloudStalker
Big Cone-huna
Big Cone-huna
Posts: 2581
Joined: 14 Jan 2007 19:00
VLC version: OVER 9000!!!
Operating System: It's...blue screen
Location: Heaven? No no. What's that other place that starts with an "H"? Oh yes: Home. ^_^

Postby CloudStalker » 01 Jun 2007 18:42

:) Wow. Who would've thought a Moderator could be so cruel; there's hope for CloudStalker yet. :P

DJ
Cone Master
Cone Master
Posts: 8206
Joined: 01 Jan 2006 04:30
Location: Koloa, Hawaii USA

Postby DJ » 01 Jun 2007 20:10

:twisted: Yup! That's ME! The guy who never got the meaning of the word "empathy". :P

Hmm! Must need vitamins or something. :idea: More Jamba Juice!

MetalheadGautham
Big Cone-huna
Big Cone-huna
Posts: 720
Joined: 25 Apr 2007 23:11
VLC version: 0.9 series
Operating System: ArchLinux i686
Location: well....... there is a door in front of my house
Contact:

Postby MetalheadGautham » 02 Jun 2007 12:12

:twisted: Yup! That's ME! The guy who never got the meaning of the word "empathy". :P

Hmm! Must need vitamins or something. :idea: More Jamba Juice!
hey all! I realised that DJ is for Drunk Junkie :twisted:
Visit: VLC and Other alternatives to Popular Media Players
Website: thesmallerbang.wordpress.com
On Linux, blindly use VLC, SMPlayer, Kaffeine, GXine, Totem and MPlayer
Image
PM requests to attend to problems will not be entertained
Please post your question in the RIGHT forum.
SEARCH before posting to see if your question's been already answered

Trollslayer
Blank Cone
Blank Cone
Posts: 26
Joined: 19 Jun 2007 02:50
Location: Bristol, UK

Re:

Postby Trollslayer » 14 Jul 2007 11:07

Why is Linux kernel in C and not in C++ ?
Legacy, pure and simple.

Trollslayer
Blank Cone
Blank Cone
Posts: 26
Joined: 19 Jun 2007 02:50
Location: Bristol, UK

Re:

Postby Trollslayer » 14 Jul 2007 11:08

Well, yes, but C is faster for many tasks and more supported in many platforms.
Which platforms have C compilers but not C++ then?

dionoea
Cone Master
Cone Master
Posts: 5157
Joined: 03 Dec 2003 23:09
Location: Paris, France

Re: Why was VLC written in C and not C++?

Postby dionoea » 17 Jul 2007 15:58

Lots of handheld devices... although that doesn't count for VLC.
Antoine Cellerier
dionoea
(Please do not use private messages for support questions)


Return to “Coffee Corner”

Who is online

Users browsing this forum: No registered users and 3 guests