[comp.lang.c++] Learning C++

yoshio@ucrmath.ucr.edu (yoshio nakamura) (01/04/91)

Can someone please recommend a good C++ text to learn C++ with?  I will
be using the GNU g++ compiler on a SPARCstation 1 running SunOS 4.1.

Is version 2.0 or 2.1 the latest version of cfront by AT&T?

Is there a FAQ posting for this group?  If so, can someone send me a copy?

thanks,

-yoshio

fer9483@tesla.njit.edu (01/30/91)

Just a quick beginner question here:

DO I need to know C before attempting to tackle C++, or can C++ be learned on
its own?

-Frank Rachel

jbuck@galileo.berkeley.edu (Joe Buck) (02/01/91)

In article <1108@tesla.njit.edu>, fer9483@tesla.njit.edu writes:
> Just a quick beginner question here:

> DO I need to know C before attempting to tackle C++, or can C++ be learned on
> its own?

No, you don't need to know C before attempting to tackle C++, and C programmers
need to "unlearn" a lot of things before they become really good C++ programmers.
I wouldn't recommend learning C++ as your first language, however -- you should
know some other language first, say Pascal.

--
Joe Buck
jbuck@galileo.berkeley.edu	 {uunet,ucbvax}!galileo.berkeley.edu!jbuck	

fischer@iesd.auc.dk (Lars P. Fischer) (02/05/91)

>>>>> On 30 Jan 91 15:05:10 GMT, fer9483@tesla.njit.edu said:

Frank> DO I need to know C before attempting to tackle C++, or can C++
Frank> be learned on its own?

Not at all. A book such as Lippman: "C++ Primer" (Addison-Wesley,
1990) will teach you C++ without any need for prior knowledge of C.

/Lars
--
Lars Fischer,  fischer@iesd.auc.dk   | Beauty is a French phonetic corruption
CS Dept., Univ. of Aalborg, DENMARK. |                   - FZ

davew@tove.cs.umd.edu (David G. Wonnacott) (02/06/91)

In article <1108@tesla.njit.edu> fer9483@tesla.njit.edu writes:
>DO I need to know C before attempting to tackle C++, or can C++ be learned on
>its own?

You do not need to know C before learning C++.  If your final goal is
to become proficient with C++, I would recommend that you do NOT start
by learning C for 2 reasons:

1) Although you will, in time, learn all the features of C (its a subset
of C++), you do not have to learn them first.  It is hard to do much in
C without knowing the entire language.  In particular, it can be hard
to understand the I/O facility and the traditional method for handling
strings, without an understanding of pointers and memory allocation.  If
you get a C++ compiler with the stream I/O library and a good string
library, you can put off the real subtleties of C & C++ until you are
comfortable with coding simple programs.

Perhaps even more important in the long run:

2) While the C language is a subset of the C++ language, good C style is
not a subset of good C++ style.  Much of the difficulty in teaching C
programmers to program well in C++ lies in trying to get them to let go
of some of the techniques they use all the time in C (I know this from
experience -- I spent several years teaching C++ to C programmers).


Dave Wonnacott (formerly of AT&T Corporate Education & Training)
davew@tove.cs.umd.edu

fischer@iesd.auc.dk (Lars P. Fischer) (02/06/91)

>>>>> On 5 Feb 91 20:21:21, davew@tove.cs.umd.edu (David G. Wonnacott) said:

David> 2) While the C language is a subset of the C++ language, good C
David> style is not a subset of good C++ style.  Much of the
David> difficulty in teaching C programmers to program well in C++
David> lies in trying to get them to let go of some of the techniques
David> they use all the time in C (I know this from experience -- I
David> spent several years teaching C++ to C programmers).

To paraphrase Dijkstra: The trouble with learning C is all the things
you then have to painfully unlearn.

If I was to teach an introductory course, I would much prefer C++. If
you stick to the basics, C++ is easier to understand and more well
structured than C. With C++ you would learn to do do abstract data
types *right*, with language support. In general, you rarely, if ever,
have to resort to "wizard tricks" in C++.

/Lars
--
Lars Fischer,  fischer@iesd.auc.dk   | Beauty is a French phonetic corruption
CS Dept., Univ. of Aalborg, DENMARK. |                   - FZ

mat@mole-end.UUCP (Mark A Terribile) (02/12/91)

> David> 2) While the C language is a subset of the C++ language, good C
> David> style is not a subset of good C++ style.  Much of the
> David> difficulty in teaching C programmers to program well in C++
> David> lies in trying to get them to let go of some of the techniques
> David> they use all the time in C ...
 
> To paraphrase Dijkstra: The trouble with learning C is all the things
> you then have to painfully unlearn.
 
> If I was to teach an introductory course, I would much prefer C++. If
> you stick to the basics, C++ is easier to understand and more well
> structured than C. With C++ you would learn to do do abstract data
> types *right*, with language support. In general, you rarely, if ever,
> have to resort to "wizard tricks" in C++.

I think that you are all missing the point.

The fellow did not ask if he should become an expert C programmer before
he became a C++ programmer.

He asked if he should learn C first.

To that I answer, most affirmatively, YES!

Or, if you like, he should learn the subset of C++ that is ANSI C and learn
it well enough to be able to get it past a C compiler (whose error messages
are likely to be drawn from a more limited set) before trying to go on to
the rest of C++.

C++'s syntax, approach to expressions and lvalues, approach to pointers and
objects, etc., are all so strongly flavored that a programmer is much better
off learning to deal with them before trying to acquire the C++ mindset.

Should he then become an expert C programmer?  No, because that usually
means staying close to the machine instead of creating an architecture or
model and coding within that.  At the point where he is no longer trying to
figure out what the compiler is complaining about, he should move on to C++.

But he should learn that `C subset' first, and preferably on a C compiler
that won't think that his error with C constructs is an error with virtual
base classes and give him a message appropriate to the latter--which he
won't understand for a long time.
-- 

 (This man's opinions are his own.)
 From mole-end				Mark Terribile

Ricardo.Zamel@f734.n250.z1.UUCP (Ricardo Zamel) (05/10/91)

AREA:COMP.LANG.C++
I just got my copy  of Borland's new C++. However, as I have never 
actually programmed in C before, I was hoping someone could suggest a 
source for learning the language (especially window's programming). I do 
have a working knowledge of Pascal.

--  
------------------------------------------------------------------------------
Ricardo Zamel - via FidoNet node 1:250/701
UUCP: ..!lsuc!eastern!nts!734!Ricardo.Zamel
INTERNET: Ricardo.Zamel@f734.n250.z1.UUCP
------------------------------------------------------------------------------

hardin@tycho.CND.HP.COM (John Hardin) (05/18/91)

Ricardo.Zamel@f734.n250.z1.UUCP (Ricardo Zamel) writes:

>I just got my copy  of Borland's new C++. However, as I have never 
>actually programmed in C before, I was hoping someone could suggest a 
>source for learning the language (especially window's programming). I do 
>have a working knowledge of Pascal.
----------

C++ for Pascal Programmers
     by Ira Pohl

John Hardin
j_hardin@cnd.hp.com
-----------