Re: Not convincing yet (c vs c++)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Nov 13, 2003 at 11:49:56 +0530, nix wrote:
> Hi guys 
>            Well I read the faq and all the arguements but they are not 
> convinicing. They 'had' tried to make one kernel with c++ but it did not live 
> upto the expectations (space time drawbacks). The drawbacks are those of a 
> the "then" c++ compilers. the compilers must have been become better. There 
> is this Intel 7.0 c++ compier released which seems to be a competitor to the 
> Gnu's Compiler maybe with that one...(who knows).

Since intel C compiler is actualy quite a lot better than GCC, if the
C++ compiler is merely a competitor, it's actualy no good ;-).

> Conceptually c++ beats c anytime, 

It's a matter of taste. IMO c++ can't conceptualy beat anything, because
it does not have a concept. Usualy, C code is a lot more readable,
unless the C++ code is VERY good written. And there are not too many
GOOD programmers.

> but is limited in the practicality (as semed in those days). Things 
> must have changed with the compiler technology and we must have better c++ 
> compilers now.

Since C is mostly a subset of C++, C++ can never get better. It can at
most get as good (but there are features in C++ that can't).

>          Other arguments that c code being better than c++ (all compiler 
> dependent and an age old myth; if anyone can prove this, then aggreed), many 
> c users etc, are not firmly based. So until one shows the advantages of a c++ 
> based kernel, c still rules. C is a subset of c++ and even linear logic with 
> functions and structures can be used. So i dont see why not go for it.

And, by the same logic I don't see why DO. One only does things when
it's actualy WORTH the effort. The FAQ says, that kernel has about
4 milion lines of code. I can't imagine ANYTHING that would be WORTH
converting to be at least compileable with C++ compiler (c++ reservers
many identifier used throughout kernel and would complain about some
typecasting that C does implicitly and is quite common).

>          What ultimately matters is concepts and applications of concepts. why 
> simulate object oriented concept in c when c++ already defines a clean
> way to do it. 

Perhaps because the objects, as used in kernel, offer much MORE
flexibility, that what C++ objects offer (you can't exchange virtual
methods RUNTIME, but you CAN do that with function pointers -- in
several places the pointers are actualy copied runtime from some other
structure as a matter of optalization).

> maybe the compiler is not good aggreed, fine. But with a farsighted 
> perspective it is only a matter of time we would have a vey good c++ 
> compiler. The code can still be ported, cant it?

What would be the benefits of doing so? Again, it's some 4 million lines
of code and things that won't compile witch C++ compiler are not
uncommon in that code.

-------------------------------------------------------------------------------
						 Jan 'Bulb' Hudec <bulb@ucw.cz>
--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux