Re: language books don't get outdated

From: Jerry Coffin (jcoffin_at_taeus.com)
Date: 08/25/04


Date: 25 Aug 2004 08:03:36 -0700


"Carter Smith" <news@email.icarusindie.com> wrote in message news:<0zWWc.23594$L94.10276@fed1read07>...
> "old" programming books are no more outdated than last year's dictionary or
> last years algebra text book.

This simply isn't true.

Many older books on C++ had all sorts of problems relative to the
language as it stands today. For a few obvious examples:

1) assuming that new returns a null pointer upon failure.
2) making no attempt at exception safety.
3) advocating inheritance when templates would be more appropriate.
4) advocating classes that imitate superior ones in the library.

The bottom line is pretty simple: even among new books, there's a
distressingly small percentage that teach the language is it exists
today. As the books get older, that percentage diminishes very
quickly.

> Especially with C++ which had been
> standardized before many newbies had been born. A book that teaches how to
> use classes and other core OO topics or even just how to use the basics of
> the language will never go out of date.

C++ has not been standardized for a particularly long time, and books
as a whole have lagged well behind the standard. There ARE excellent
books on things like OO analysis (E.g. Booch) algorithms (going back
at least as far as Knuth) and so on, but when it comes to the language
proper, few older books retain a great deal of value.
 
> C++ has added new ways to do the same old same old and there's no harm in
> doing the same old same old the same old way. Because it still works.

Quite the contrary. Just for one obvious example, the minute exception
handling was added to the language, MANY of the old ways of doing
things were instantly broken. Teaching people to write code that isn't
exception safe is actively harmful.

[ ... ]

> Should we ignore that core theory of geometry simply because it's thousands
> of years old and new theories related to geometry have come about?

Of course not -- but the simile is poor at best. In the case of
geometry, the definition of what's being taught is old. In the case of
C++, the definition of the language has NOT existed for thousands of
even dozens of years. Worse, most books did not (even attempt to)
follow the standard as soon as it was approved.

There are two basic problems here. First of all, many new books aren't
entirely new -- they're revisions of older books. Unfortunately for
that, C++ has changed enough, quickly enough, that most of revisions
aren't really adequate to address the changes that have taken place.
In many cases it appears that _several_ revisions will be necessary
before the books catch up with the current standard.

Second, especially in introductory books, the author faces a serious
problem at best: the market forces him to teach the language as
defined by mainstream compilers rather than as defined by the
standard. Until recently, and to a lesser degree even now, that meant
many books were taught C++ within the restrictions imposed by MS
Visual C++ 6.0 (which predates the standard).

Even after the author and publisher agree that an up-to-date book is
needed, it can easily take a year of serious work to write a good
book, and months after that to get it published.

> You
> can't get much more outdated than 2000 years and yet here we are still
> teaching it and relying on it.

This assumes that being dated depends purely on age, which clearly
isn't true.

Some parts of geometry haven't change radically since then, but
medical practices, knowledge of chemistry, physics, etc. certainly
have. If, however, you want to restrict yourself to what the Greeks
knew about computer programming (i.e. nothing) feel free to do so --
but don't expect everybody else to share your enthusiasm for
ignornace.
 
> The STL and templates are not without controversy. It's not like everyone
> just assumes they're the best thing ever. If you want to learn how to use
> that stuff with "up to date" books then that's fine. There are entire books
> dedicated the the STL and templates. For my audience I go with the basic
> OOP style. If you're an advanced programmer and insist on templates and
> whatnot then that's your choice. But it's not my target audience.

Templates, for one example, are nearly unavoidable except by the very
most advanced programmers. Just for an obvious example, the minute you
write a hello world program that writes to cout, you've used a
templated class. That class is defined in such a way that it can throw
exceptions.

The fact is, that in C++ you can't avoid templates and exceptions and
so on. If you ignore them, you write broken code. If you teach others
to ignore them, you teach them to write broken code.

-- 
    Later,
    Jerry.
The universe is a figment of its own imagination.


Relevant Pages

  • Re: subroutine stack and C machine model
    ... They could have standardized that the language would be ... getting the facts wrong anyway. ... And the answer, for the Schildt books, is that they consistently produced ... to C start with the standard. ...
    (comp.lang.c)
  • Re: Translations from UK to US
    ... : No - I have no gone to the extent of saying directly what the British: idiotshave regularly: posted as insults to the intelligence of the American children reading: the books. ... I have made it clear that there was NO effort by the editors: and author to simplify the books. ... Titles have been changed regularly -: the first books in France uses the title Levine suggested for the: American Version - and I have not heard your outrage about that. ... So it does not reflect on the language itself. ...
    (alt.fan.harry-potter)
  • Re: [FAQ] How can I open a file, skip first 2 lines and get the 50th character?
    ... Standard C has a single library, ... many books are available for this purpose. ... recommended one is the 'classic' "The C Programming Language, ... Second Edition," by Brian Kernighan and Dennis Ritchie (Mr. ...
    (alt.comp.lang.learn.c-cpp)
  • Re: SCWC 32: Discussion: IMPLEMENT
    ... Latin to English, such as "don't split infinitives" or "don't use ... language can be changed deliberately. ... I've got two books by Roy Harris that I ... must get around to reading. ...
    (rec.puzzles.crosswords)
  • Re: successful language learners -- the little details
    ... > best attack plan for the language is... ... Before I waste my time randomly picking words out of books ... > Supermemo per day until I have learned'em all. ... I carry a pad in my back pocket at all times. ...
    (sci.lang.japan)

Loading