LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Discussion: Why use C/C++? (https://www.linuxquestions.org/questions/programming-9/discussion-why-use-c-c-151312/)

Strike 02-29-2004 12:27 PM

Quote:

Originally posted by Stack
You named your thread why use C/C++ so that is a valid response like it or not.
Yes, and we already touched on the "the specs require it", which would be the result of a job requiring it. This is a discussion about why YOU as a program designer would choose to use C or C++ over any other language (not just Python) for any given project. Let's keep it focused on that and let's keep accusations out of it.

shortfuse 02-29-2004 04:10 PM

Well as far as why use C it's simple for me, it's portable. No other language can match the C's portablility, that's why it is the defacto standard language for compilers/interpreters. Without C we wouldn't have Perl, Python, Java, or VB just to name a few.

C++ is just an extension of C that allows for much better abstraction which in turn allows for very large projects to remain managable.

Just my 2 cents.

Strike 02-29-2004 05:46 PM

Quote:

Originally posted by shortfuse
Well as far as why use C it's simple for me, it's portable. No other language can match the C's portablility, that's why it is the defacto standard language for compilers/interpreters. Without C we wouldn't have Perl, Python, Java, or VB just to name a few.

C++ is just an extension of C that allows for much better abstraction which in turn allows for very large projects to remain managable.

Just my 2 cents.

That's pretty ridiculous, considering that 3 of the 4 languages you mentioned are more portable than C, generally speaking. And althought it's a bit of a joke adage, there's something worth pondering in: "C combines the
power of assembly language with the portability of assembly language."

shortfuse 02-29-2004 05:54 PM

Quote:

Originally posted by Strike
That's pretty ridiculous, considering that 3 of the 4 languages you mentioned are more portable than C
Pretty ridiculous?!

All their respective compilers/interpreters are written in C!

That was my point.

cjcuk 02-29-2004 06:10 PM

Quote:

Originally posted by Strike
That's pretty ridiculous, considering that 3 of the 4 languages you mentioned are more portable than C, generally speaking. And althought it's a bit of a joke adage, there's something worth pondering in: "C combines the
power of assembly language with the portability of assembly language."

Not to be offensive, but you really seem on the war path against C. Do you know how many operating systems implement things like POSIX? C is a lot more portable than you are making it out to be. Now, I am not claiming it is some ultra-portable language like the interpreted languages can be ( if well written, in much the same way as you have to pay attention to what standards you are writing your C code to ), I just cannot understand how you cannot see that. I think that the way this thread is going is becoming futile -- somebody states a view about C ( often at least slightly-biased by opinion ) you dispute it, again based, in part at least, on opinion. This is not meant to be an ad hominem attack, I just feel that this thread needs to be more objective -- though it is hard for it to become that when it's initial premise seems to be an assault against C ( and C++ ). I hope this post is not misconstrued, but I felt it needed to be said.

As a side note, I think you probably realise that the quote does not get across the point the author of the post was trying to make. I believe he most likely meant something like, ``C combines the power of assembly language with the portability lacking from assembly language''.

Strike 02-29-2004 07:40 PM

Quote:

Originally posted by shortfuse
Pretty ridiculous?!

All their respective compilers/interpreters are written in C!

That was my point.

Yes, and they are all special-cased for each platform they run on! And the executables most certainly wouldn't run on systems other than the ones they were compiled for initially.

Strike 02-29-2004 07:51 PM

Quote:

Originally posted by cjcuk
Not to be offensive, but you really seem on the war path against C.
Warpath? I'm not getting angry or anything ...

Quote:

Do you know how many operating systems implement things like POSIX? C is a lot more portable than you are making it out to be.
Yeah, it's somewhat portable, but other languages are a lot MORE portable. The jab at it being as portable as assembly was a bit of a joke.

Quote:

I think that the way this thread is going is becoming futile -- somebody states a view about C ( often at least slightly-biased by opinion ) you dispute it, again based, in part at least, on opinion.
Well, that was kind of the point of this thread. I'm trying to find what bad reasons people justify using C/C++ for so I can tell them why they are bad :) Some of them have been good, though, and I've conceded to them.

Quote:

This is not meant to be an ad hominem attack, I just feel that this thread needs to be more objective -- though it is hard for it to become that when it's initial premise seems to be an assault against C ( and C++ ). I hope this post is not misconstrued, but I felt it needed to be said.
I don't feel I'm being unnecessarily subjective, but feel free to show me where I have been. I have had to narrow the scope a bit to clarify my original point (because I do realize there are a few arenas where C/C++ are just about the only choice), but other than that I'm not sure where my opinion has factored in.

shortfuse 02-29-2004 08:03 PM

Strike,

The point I'm trying to make is those languages wouldn't exist without C. That "special cased" code your referring to ENABLES you to execute your code. Only a madman would try to port a compiler written in assembly...what other choice does a developer have?

xarius 02-29-2004 08:10 PM

I am going to answer this, regardless of how trollish the initial post was.

Basically, programs written (and written well) in C/C++ are fast. That is the prime reason for anyone using C++. Even in this day and age with fast machines, speed is of the essence. a few seconds of performance loss might not seem important, but then how many programs/daemons/scripts etc. do you run on your machine in a day?

Let's say 50 (for the sake of the argument). If all these programs were written in Java, and perform at about 3/4's the speed of C++, how much time have you lost just waiting for things to happen.

Also the "memory management" argument is ludicrous, I hardly ever have to bother with managing memory, if I don't want to.

Yeah, umm. C++ is amazing. It's been around for a long time, has a standards committee etc. Just use it like everyone else instead of trying to be controversial and non-conformist ok?

(Right tool, Right job etc. of course...)

chewysplace 02-29-2004 08:17 PM

Quote:

Originally posted by krajzega
1. 95 precent of UNIX is written in C/C++
2. Most *NIX apps are written in C/C++
3. C and C++ can learn you many aspects of programming but also lots of computer issues, for example alocating memory, working on streams, tcp/ip ..and it can make you understand it not only in programming case (for example: I couldn't have understand tcp/ip without programming sockets..it was too difficult).
4. Its the best language
5. However it can be right question on windows or dos programming forums, here is just stupid

i'd have to agree with this for the most part. though since i'm taking a Concepts of Programming Languages course i'm beggining to see why c/c++ isnt all that great. but it is the best for now.

from what i can tell about this whole "discussion" though is someone wanting to pick a fight and say he's right. *cough* strike *cough* but aside from his comments everyone has put up some legitimate arguments.

Strike 02-29-2004 09:32 PM

Quote:

Originally posted by xarius
I am going to answer this, regardless of how trollish the initial post was.
How trollish was it? It wasn't trollish at all. It was an honest question intending to elicit honest answers from people.

Quote:

Basically, programs written (and written well) in C/C++ are fast. That is the prime reason for anyone using C++.
You can't speak for everybody, and nor can I. That's why I am asking for people's reasons in choosing C/C++ when they decide to create a program. When speed is of paramount importance, I fully understand (and generally agree with) the choice of C/C++ as the implementation language.

Quote:

Even in this day and age with fast machines, speed is of the essence. a few seconds of performance loss might not seem important, but then how many programs/daemons/scripts etc. do you run on your machine in a day?

Let's say 50 (for the sake of the argument). If all these programs were written in Java, and perform at about 3/4's the speed of C++, how much time have you lost just waiting for things to happen.

First of all, a few seconds is always important, but other implementations would introduce delays of maybe milliseconds. And also, as I've said a few times now, I'm not talking about daemons or anything else, so 50 is a ludicrous number to use as an example. Most people are hardly ever using more than a dozen interactive apps at once, and they certainly aren't actively using more than a handful of those apps at once.

Quote:

Also the "memory management" argument is ludicrous, I hardly ever have to bother with managing memory, if I don't want to.
Then (assuming we're talking about C/C++) either (a) you aren't making secure programs, (b) you aren't making any programs, (c) you're using some sort of compiler patch, or (d) you are bothering with it

Quote:

Just use it like everyone else instead of trying to be controversial and non-conformist ok?
I hope this is a joke, but there's no smiley or anything like that to indicate that it is. But I seriously hope that it is.

Strike 02-29-2004 09:36 PM

Quote:

Originally posted by chewysplace
from what i can tell about this whole "discussion" though is someone wanting to pick a fight and say he's right. *cough* strike *cough* but aside from his comments everyone has put up some legitimate arguments.
No, it's me being very bewildered at why people in general make what seem to me to be asinine choices in their choice of programming language for projects where speed isn't a factor and a higher-level language would not only make their program easier to write, but more portable and easier to maintain and improve upon. There's no fight going on, so how can you say I've picked a fight? And where have I declared myself "right"?

I am getting very tired of being accused of things in this thread. If you have an issue with me or this thread, take it up with me or the forum moderators outside of the thread and try not to draw attention away from legitimate discussion in the thread.

xarius 02-29-2004 10:18 PM

Hey, if you don't like C/C++ don't use it. And if you don't like people questioning *your* choices, then don't talk about them in a public forum.

chewysplace 02-29-2004 10:47 PM

LOL

eshwar_ind 02-29-2004 11:01 PM

I Love C
I Like C++
I Love Linux
I Dont Like Java
thats the reason


All times are GMT -5. The time now is 01:05 PM.