[ale] C programming books
Benjamin Scherrey
scherrey at switchco.com
Wed Jun 2 07:21:19 EDT 1999
Joe Knapka wrote:
> Benjamin Scherrey wrote:
> >
> > I recommend that you buy a C++ book instead and learn that. There is
> > absolutely no reason to learn plain old C any more and if you later
>
> While C++ is better than C for almost any task, I don't agree with this
> statement. Since the C subset of C++ is *not* identical with C, if you
> have to maintain a large body of C code (say, the Linux kernel <-- ON
> TOPIC;^),
> you will need a good C reference. Also, you can go out and steal
> or buy an ANSI-standard-compliant C compiler; this does not yet
> seem to be true of C++. (And specifically, the GNU implementation
> of C++ is nowhere near as good as some commercial compilers,
> which is sad. However, C++ is literally at least an order of magnitude
> more complicated than C by almost any measure you choose, so
> it's not surprising that the free software community has taken a
> while to chase down the language definition.)
Fortunately the egcs C++ compiler is now officially the GNU C++
compiler so your reservations on finding a good free C++ compiler can
be relived. The egcs compiler is at least in the top three for ANSI
C++ compliance and definitely the #1 spot for the number of platforms
it supports.
As far as complexity goes, remember that over half of the C++
specification is its standard library. K&R C had a minimulistic (at
best) standard library but the upcoming ANSI update to C is going to
make it nearly as large as C++! Also, C++ was designed so that you
don't pay for what you don't use. If you don't need all the standard
library features, you won't suffer a single byte or cpu cycle of
overhead if you don't use them. I find that the IOStreams library, C++
strings, and a few of the containers from STL make the language far
more easy for new programmers or those with experience with higher
level languages to learn and produce useful code. The fact is that one
rarely develops a useful application with old C without some external
library linked in with it.
> > decide to learn C++, you'll have to unlearn a bunch of bad habits that
> > are common usage with C. You don't have to program object oriented to
> > use C++. Just take advantage of it's easier to use constructs, type
> > safety, great standard library (strings and containers oh my!) and
> > you'll be a good bit further along than with plain old C.
>
> I agree with the above.
>
> > Its also much easier for a new programmer to learn than C.
>
> Eh? K&R, 2nd ed., 261 pages. Stroustrup, 3rd ed., 870 pages.
> Each of these books contains, in theory, everything you
> ever need to know to be a competent C or C++ programmer,
> respectively.
See my statement to the contrary above. And please compare ANSI C to
ANSI C++ or else compare K&R C with ARM C++. The two groups serve very
different purposes.
> I suppose if you're used to something like VB, it's easier
> to find a C++ feature or library that does approximately
> the same thing (except GUI-wise); however, C++ is probably
> the easiest language I've ever seen in which to implement
> auto-pedal-ballistic code :-) (I've pretty much reduced
> my own feet to bleeding stumps over the past
> few years...)
I agree. I also have been suggesting that some people just go ahead
and learn Java first but it hasn't been stable enough and you sure
have to type a lot to get anything done. Fortunately, once Java 2
settles in this should be a viable alternative. Get a new person into
Java and once they figure out where they need performance, move them
into C++.
later,
Ben Scherrey
More information about the Ale
mailing list