REVIEW - STL Programming from the Ground Up

Title:

STL Programming from the Ground Up

Author:

Herbert Schildt

ISBN:

0078825075

Publisher:

McGraw-Hill Osborne Media (1999)

Pages:

442pp

Reviewer:

Mark Radford

Reviewed:

February 2000

Rating:

★☆☆☆☆

This is another book that takes the reader through the STL. This one vaguely touches on how it can be extended with user-written components (as far as I can see it offers nothing over other books in this respect). The cover boasts that the author has sold more than two million books. The style of writing is clear and easy to read, so it's easy to see that this book will appeal to programmers browsing in the bookshop. Having said that, books by this author have, in the past, not been well received by ACCU reviewers, generally speaking. Similarly, this book is not well received by this reviewer. To see why, a close look is needed.

One of the problems is not what is in the book, but what is left out. For example, the text mentions that for class vector, the relational operators (==, !=, and>=) are defined, but I could find no explanation of their semantics. Also, in the same chapter, there is a short explanation of the vector specialisation, with no mention of the fact that it does not meet the requirements for a standard container (basically because the reference member is a 'smart reference' rather that a true reference to a bool and does not return an lvalue). This can lead to surprises when using vector in conjunction with certain algorithms, where it is assumed that the reference member will return an lvalue.

In addition to this, there are occurrences of incorrect code with respect to the C++ standard (note that the copyright date is 1999). For example, the quoted standard class iterator_traits (page 293) will not compile with a standard conforming compiler (the keyword typename is required, prefixing the qualified names dependent on the template parameter Itr).

If that's not enough, there are some practices used in the sample code that should not be imitated. For example, the failure to make accessor functions const and the assumption that all character sets are ASCII (with expressions such as 'A' + i). Further, I found the coding style untidy and hard to follow, especially considering the simple nature of most of the examples.

Therefore, if you want an STL book, have a look through the reviews on the web site, where you will find books that do a better job.


Book cover image courtesy of Open Library.