Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

C and C++ comparison

21 views
Skip to first unread message

Anil Khatri

unread,
Apr 19, 1992, 1:08:48 AM4/19/92
to
Hi!
I am interested in reading a detailed comparison between C and C++
regarding their pros and cons. If anyone of you have some documentation about
it could you please mail it to me, or just send me some good points for
comaparison.

Eric Smith

unread,
Apr 19, 1992, 9:35:13 AM4/19/92
to


The pro of C++ is that it is a superset of C so it has the advantages,
if any, of C, plus a lot of much more valuable advantages of its own.

The con of C is that it is totally obsolete, because C++ subsumes it.

Using C instead of C++ adds to your software development costs. Only the
government wants to waste money like that.

Pete Roth

unread,
Apr 20, 1992, 8:48:40 AM4/20/92
to
In comp.lang.c++, er...@tfs.com (Eric Smith) writes:
[...]

>Using C instead of C++ adds to your software development costs. Only the
>government wants to waste money like that.
^^^^^
Well, we don't really _want_ to waste money...

regards, pete
- - - - - - - - - - - - - - - - - - - - - - - - - -
Peter N Roth ro...@oasys.dt.navy.mil
Just another victim of the GUI-induced Mouse Elbow Syndrome.

Don Hopkins

unread,
Apr 21, 1992, 3:36:36 PM4/21/92
to
In comp.lang.c++, er...@tfs.com (Eric Smith) writes:
>Using C instead of C++ adds to your software development costs. Only the
>government wants to waste money like that.

You could extend that argument to say that using C++ instead of Eiffel,
or Smalltalk, or any other real object oriented programming language,
just adds to your software development costs and wastes money.

Another silly argument somebody put forth was that you should use C++
instead of C because the one thing that C++ does best is make C obsolete.
C was already obsolete before C++ came along.

Those people touting C++ as an acceptable first programming language
most likely don't know any other languages. If you first learned C,
and then learned C++ because it was so similar, and you're unwilling
to learn another language that's substantially different, then sure
you should be using C++, but you certainly shouldn't be a computer
science student, and you shouldn't inflict your prejudices on other
people who are open minded enough to learn something new and different.

Have some mercy for people who are willing to learn.
Teach them Scheme.

-Don

Scott W. Haney

unread,
Apr 22, 1992, 12:29:56 AM4/22/92
to
hop...@coulin.turing.ac.uk (Don Hopkins) writes:

>Another silly argument somebody put forth was that you should use C++
>instead of C because the one thing that C++ does best is make C obsolete.
>C was already obsolete before C++ came along.

>Those people touting C++ as an acceptable first programming language
>most likely don't know any other languages. If you first learned C,
>and then learned C++ because it was so similar, and you're unwilling
>to learn another language that's substantially different, then sure
>you should be using C++, but you certainly shouldn't be a computer
>science student, and you shouldn't inflict your prejudices on other
>people who are open minded enough to learn something new and different.

>Have some mercy for people who are willing to learn.
>Teach them Scheme.

> -Don

Don,
By all indications, C++ is not the first programming language taught
to students. Therefore, your comment about people recommending C++
because that's all they know is a bit of hyperbole. I suspect most
people start with Pascal, C, Fortran, or Basic. Moreover, I don't think that
teaching C++ will damage anyone. On the contrary, I think C++ can provide
a good vehicle for learning basic programming techniques + some OOP.
Also, looking through classified ads here in the Bay Area I see that
knowledge of C/C++ appears as a requirement for significantly more
programming jobs than Scheme. (In fact, just skimming, I see no ads
even mentioning Scheme.) Scheme is a fine language but I think there
is some justification for *initially* teaching students something that they
can put on their resumes. Finally, before attacking other people's
"predudices", I suggest you examine your own. Most of your post is pretty
inflamatory.
Scott
--
-------------------------------------------------------------------------
Scott W. Haney || Lawrence Livermore N'Lab || The above views are
ha...@random.llnl.gov || P.O. Box 808; L-644 || mine and not neces-
(510) 423-6308 || Livermore, CA 94550 || sarily LLNL's.

David Chase

unread,
Apr 22, 1992, 4:25:33 PM4/22/92
to
>hop...@coulin.turing.ac.uk (Don Hopkins) writes:
>>Have some mercy for people who are willing to learn.
>>Teach them Scheme.

In article <haney.703916996@moonshine> ha...@moonshine.llnl.gov (Scott W. Haney) writes:
> ... I don't think that teaching C++ will damage anyone.

I disagree (says he who started with PL/1, and moved on to BCPL and
Fortran, and thence to C). For those people who currently go on to
become programmers, probably nothing will damage them permanently. I
think the damage is done by driving other people completely away from
programming. C and C++ are both chock full of arbitrary irrelevant
rules and surprises that do not encourage people to view programming
as something that they can do. Scheme, horrible as its syntax seems
to some, has few surprises, and not many irrelevant rules. (Before
you flame back about the relevance of the rules, ask yourself why

int * f() {
int x = 1;
return &x;
}

is an bad function, and then ask yourself how to explain this to a
beginning programmer.)

>Also, looking through classified ads here in the Bay Area I see that
>knowledge of C/C++ appears as a requirement for significantly more

>programming jobs than Scheme. ...


>Scheme is a fine language but I think there is some justification for
>*initially* teaching students something that they can put on their
>resumes.

I think this is a silly justification for teaching C++ (as a first
language, which is what the thread was originally discussing). People
who only take one programming course are much better off with
something like Scheme, and it probably doesn't have much to do with
their future employability, because one course is not sufficient.
People who take additional programming language courses can learn the
other languages that they can put on their resumes.

Also when looking at classified ads, don't forget good old Cobol,
Fortran, and RPG.

David Chase
Sun

Scott W. Haney

unread,
Apr 23, 1992, 11:39:16 AM4/23/92
to
David,
I don't find your points about syntax convincing at all. Moreover, one
could explain the problem with the code fragment you gave in a few sentences.
I think it perposterous to claim that students could somehow be intellectually
damaged for life by the process of learning C-style syntax.
My comment about the want ads is only silly to people like yourself who
already have jobs. I think schools have an obligation to teach stuff
that has more than just theoretical interest. This is especially true in
an introductory programming course, which may be the only one some non-CS
majors take. Like it or not, there aren't too many word processors or
engineering codes written in Scheme. As a result, I think you would be doing
many people a disservice by teaching Scheme as a first language. I think
one really has to choose from the widely used languages: C, C++, Fortran,
and Pascal.
I will say that there are some institutions, such as MIT, CalTech, etc,
where it is a fairly good assumption that the students have done some
programming before they enter college. In this case, I think it is appropriate
to teach a language like Scheme in the introductory class. In fact, when
I was there, I think this is what was happening at MIT.
I'll close by echoing Jim Adcock's call for real data on teaching C++
to real students as a first programming language.

Mark Culotta

unread,
Apr 23, 1992, 4:42:19 PM4/23/92
to


Well, I was an undergraduate at MIT at the point when they restructured the EECS
curriculum to consist of a sequence of 4 "introductory" classes required for everyone
in the department followed by 3 or 4 more required classes specific to CS or EE.
The first required class was 6.001 "Structure and Interpretation of Computer Programs".
We got to proofread the textbook, which for us consisted by a ton of loose leaf pages
:-(.

In article <haney.704043556@moonshine> ha...@moonshine.llnl.gov (Scott W. Haney) writes:

> My comment about the want ads is only silly to people like yourself who
> already have jobs. I think schools have an obligation to teach stuff
> that has more than just theoretical interest. This is especially true in
> an introductory programming course, which may be the only one some non-CS
> majors take. Like it or not, there aren't too many word processors or
> engineering codes written in Scheme. As a result, I think you would be doing
> many people a disservice by teaching Scheme as a first language. I think
> one really has to choose from the widely used languages: C, C++, Fortran,
> and Pascal.

I disagree. You're confusing a College level introductory CS course with a
Vocational Tech programming class. The two are entirely different beasts. If
non-CS majors are taking any programming courses, they should be taking "Computer
Programming in <fill-in-the-language>" or "Computer Programming for non-CS majors".
MIT had such courses when I was there. They taught FORTRAN. As this was a little
while ago, I suspect that they may teach something else by now, but I don't know.

> I will say that there are some institutions, such as MIT, CalTech, etc,
> where it is a fairly good assumption that the students have done some
> programming before they enter college. In this case, I think it is appropriate
> to teach a language like Scheme in the introductory class. In fact, when
> I was there, I think this is what was happening at MIT.

Actually, when I took the introductory computer programming class, the
instructor(s) said (Gerry Sussman & Hal Abelson - I don't remember who atcually
said it) that the first thing to do is to UNlearn all the nonsense that we almost
certainly had picked up by learning to program in High School (or elsewhere).

IMHO, the introductory CS course should not even be too concerned with the choice
of language. As long as the real underlying concepts can be properly communicated
to the students then the syntax required is unimportant. I have always felt that
I have a better understanding of what it takes to successfully program a computer
than just about anyone who learned C or Pascal. (Does this contradicts the H in
IMHO? :-). The concepts of abstraction, streams, scoping, recursion, etc. are
clearer to me and I can apply them effectively in *any* language in which I might
find myself programming. I think Scheme was a very appropriate and clean language
in which to demonstrate these things.

Software engineering is not about being able to code algorithms distributed by the
teacher, or found in a book, in a commonly used language (so that one can get a job).
Its about understanding problems with understanding and organizing data so that one
can make sense of it. I think it likely that, in the future, there will be more
tools that turn designs into implementation automatically. The design work won't
so easily be automated. And good design requires the understanding of basic concepts.

BTW, they didn't actually "teach" Scheme in the introductory class. They touched
on it in the first lecture and expected the students to figure out the syntax in
more detail when they tackled the problem sets (with the aid of TA's). I never
felt that learning the language was a problem despite all the parens.

The first time I needed to learn a "commercial" language was when I took a lab
class dealing with computer control of physical systems in which we were using C.
They didn't teach us the language there either.

Let me add that I _do_ think C++ is a much better language than C for teaching
the important concepts. But it is a rather complicated language. And in many ways
the data hiding and abstraction techniques are not as good as they should be, so
that their importance becomes somewhat diluted.

> I'll close by echoing Jim Adcock's call for real data on teaching C++
> to real students as a first programming language.

Likewise.


Mark Culotta


--
------------------------------------------------------------------------------

Mark Culotta | m...@centerline.com or
Software Engineer | uunet!centerline!mkc
CenterLine Software Inc. |
10 Fawcett St. | (617) 498-3311 (voice)
Cambridge, MA 02138-1110 | (617) 868-6655 (FAX)

------------------------------------------------------------------------------

Tim Lister

unread,
Apr 24, 1992, 12:47:48 PM4/24/92
to
>I think it likely that, in the future, there will be more
>tools that turn designs into implementation automatically.
> The design work won't so easily be automated.
>
>Mark Culotta
>
We already *have* that tool, imperfect as it may be.
It is called a compiler.
What is the best way to specify a design .. to an
automatic process? Why, a programming language <grin>.
(Of course you could use a hypertex/graphical tool,
and that's not a linear language, so an automatic process
implementing such a design might not be called a compiler.
Hyper-compiler? :-)

John Skaller, Maxtal P/L


John Coolidge

unread,
Apr 26, 1992, 3:12:44 AM4/26/92
to
ha...@moonshine.llnl.gov (Scott W. Haney) writes:
> I will say that there are some institutions, such as MIT, CalTech, etc,
>where it is a fairly good assumption that the students have done some
>programming before they enter college. In this case, I think it is appropriate
>to teach a language like Scheme in the introductory class. In fact, when
>I was there, I think this is what was happening at MIT.
> I'll close by echoing Jim Adcock's call for real data on teaching C++
>to real students as a first programming language.

I don't have any real data on teaching C++, but when I started as an
undergrad at Texas A&M in 1984, the department had just switched to
teaching C as a first language. I didn't notice any serious problems
with it; most students seemed to take to it very quickly. This was
despite a buggy platform (early Ultrix on a VAX 11/785 that crashed a
lot, especially if anyone used dbx). Our instructor had a bit of a
language barrier (strong accent), but was quite good and got the point
across. Very few of the students in my class had any prior programming
experience. I was the exception; I'd been programming for seven years
and had learned APL, FORTRAN, BASIC, assembly, and Pascal (in that
order, even :-)).

By contrast, in the second semester programming course we learned LISP
and three other languages. It's fair to say that our instructor was
pretty bad (amoung the worst three or so in eight years of higher
education), so these results may not say much. However, most of the
students were hopelessly confused by LISP, despite using a pretty good
text.

The results that I've seen boil down to this: good teachers can teach
programming to their students, whether or not their students have any
prior experience. Bad teachers can't teach a new language, even if the
students already know another language. And, after a few years in
school, most C.S. students have learned how to learn a new language.

I think the major concern is to assign the best educators to teaching
new students 1) how to program and 2) how to learn a programming
language. With that as your goal, you emphasize concepts and show how a
language implements them. The actual language is secondary (indeed, I
could see a pretty good case being made for teaching C/C++ and Scheme,
and maybe Smalltalk, all at once. That would decouple concepts from
implementation pretty effectively).

Of course, these comments are aimed at teaching computer scientists
(people who care about programming language concepts and theory).
Teaching programmers, I'd pick a commercially viable language and have
at it. And I've never taught beginning programmers, and I really can't
remember much of how I learned to program (my first program was written
15 years ago, when I was 11 :-)). But I have been around a fair number
of beginning C.S. types, and the above pattern (instruction is many
times as important as language) seems to always repeat.

--John

so you found a girl who thinks really deep thoughts;
what's so amazing about really deep thoughts?
-- Tori Amos, "Silent All These Years", _Little_Earthquakes_

+++John L. Coolidge++til May:cool...@cs.uiuc.edu++May:cool...@apple.com++
I speak for myself, not the UofI or Apple. Copyright 1992 John L. Coolidge.
Copying allowed only if attributed and if all copies may be further copied.

0 new messages