LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Guru = C & Lame = C++ (https://www.linuxquestions.org/questions/programming-9/guru-%3D-c-and-lame-%3D-c-148260/)

PSIplus 02-20-2004 11:00 AM

Quote:

Originally posted by chewysplace
the code only sucks as bad as teh coder can program. language realy doesnt matter.
ACK!!! The best you can say about it :-)

Hko 02-20-2004 11:11 AM

Quote:

Originally posted by moeminhtun
You know why Linux kernel is written in C?
Because that time "Linus" was still a kid (20 something) and he didn't know how to program in C++ yet.
I really do not think so! (or were you joking?)

Quote from a recent post from Linus to the kernel developers mailing list:
Quote:

In fact, in Linux we did try C++ once already, back in 1992.

It sucks. Trust me - writing kernel code in C++ is a BLOODY STUPID IDEA.

chewysplace 02-20-2004 12:27 PM

Quote:

Originally posted by PSIplus
ACK!!! The best you can say about it :-)
well tell me where i'm wrong...

Tesl 02-20-2004 07:42 PM

I love OOP in all honesty, and thats the only reason i rarely use C. Im just too happy using Java/C++, and writing my own bits and pieces :)

I never saw the point of OOP when i first started out, but id really struggle without it now, since i find it so much easier to use. I think i fell in love with it moreso when using Java, since its OO approach makes the language extremely easy to use.

I think a great deal comes down to personal preference. Chances are not great that il be writing kernel code anytime soon, thus i use either Java or C++ for essentially everything i write.

moeminhtun 02-21-2004 12:19 AM

Yeah right.
People thought that OOP is difficult and comfusing when they start learning.
Actually it's not difficult. It's just that its learning curve is very steep. It takes so much time to understand. After you understand, it takes so much time to be able to design properly. After you master it, you will realize that OOP is so much easier to write and design than any other procedure languages. So much easier to write, so much easier to modify and maintain. And it also 50% or more faster to write than the procedure languages to produce the same result. At this stage, you will never wanna go back to procedure languages when you write the application level programs.

So please don't confuse with "steep learning curve" and "being difficult".

chewysplace 02-21-2004 12:23 AM

i learned OOP C++ before i ever knew what C was so it not so hard for me :)
that and thats all they teach at my university is OOP.

moeminhtun 02-21-2004 12:33 AM



<edited>

sNicker 02-21-2004 08:39 AM

Quote:

Originally posted by PSIplus
You cann't compare Linux with Symbian, it's totally different. [/B]
The same with C and C++... I mean pure C and pure C++, no C++ mixed with C-style programming, that's quite ugly...

nakkaya 02-21-2004 10:31 AM

C and C++ are both designed for different problems c++ is designed for high level programs that run on top of the os but c is for low level programmes thats why some call c portable assembly. writing a kernel and a high level programme has diffrent priorities like linus said on that mailing list article Hko posted
linus said:
any compiler or language that likes to hide things like memory
allocations behind your back just isn't a good choice for a kernel.

this action is what you will want on a very large scale application and what you wont want on a kernel....
hope you got the idea....

gr33ndata 02-22-2004 08:09 AM

Actually
There is no such strict boundry between low level and high level applications.
You may consider device drivers as low level applications and gui funky stuff as high level application. But what about applications like sniffers and IDSs for example. I think they lie in between.
IMHO ... I think it is all about the desired design ... will it be object oriented or structural programming.
Am I right ?

krajzega 02-22-2004 08:25 AM

OFC there are a lot of differences between C and C++ but it's clear that the most important is OOB. In my opinion, classes and all methods of OOP are more necessary for bigger applications and projects. It can realy help you and make your application faster, your sorce more clean and able to easy develope.


All times are GMT -5. The time now is 10:47 AM.