Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!linac!att!att!westmark!mole-end!mat From: mat@mole-end.UUCP (Mark A Terribile) Newsgroups: comp.lang.c++ Subject: Re: Learning C++ Message-ID: <481@mole-end.UUCP> Date: 12 Feb 91 08:50:47 GMT References: <1108@tesla.njit.edu> <29911@mimsy.umd.edu> Organization: mole-end--private system. admin: mole-end!newtnews Lines: 46 > 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