- #1
- 15,926
- 5,736
Today I found out that the textbook that I taught C++ out of for several years in the late 1990s and early 2000s is now available online for free. After it went out of print, the author (Owen Astrachan at Duke University) decided to make it freely available.
A Computer Science Tapestry, second edition (1999)
I was attracted to this book because it used important features of the then-new C++ standard (1998) in preference to the C-style features that they were intended to replace:
This means that pointers come very late in the book, in chapter 12 out of 13. They simply aren't needed until then, for explicit dynamic memory allocation using
I suspect that Astrachan decided not to do a third edition because high-school (AP) and college/university intro computer science courses in the US moved from C++ to Java in the mid to late 2000s. That probably caused demand for C++ textbooks to plummet. Kind of a pity, because it really wouldn't have taken much work to bring it up to date.
The main problem with the code in this book is that it was written before C++98 compilers were widely available, so it uses Astrachan's own library and header files for strings and vectors. However, the code is compatible with std::string and std::vector, except for using different #include files, e.g.
A Computer Science Tapestry, second edition (1999)
I was attracted to this book because it used important features of the then-new C++ standard (1998) in preference to the C-style features that they were intended to replace:
- The std::vector class instead of C-style arrays, which are mentioned only briefly at the end of one chapter;
- The std::string class instead of C-style null-terminated char arrays and char* pointers, which aren't mentioned at all;
- Passing arguments to functions using references instead of pointers, when the function is supposed to change the values of the arguments and return them to the calling function.
This means that pointers come very late in the book, in chapter 12 out of 13. They simply aren't needed until then, for explicit dynamic memory allocation using
new
and delete
. I remember that I worried about this at first, and discussed it with the guy in my department who taught most of our upper-level computer science courses. He said something like, "Oh, that's fine! They'll deal with pointers in later courses like data structures, when they really need them. At your level, it's better that they get a decent introduction to object-oriented programming."I suspect that Astrachan decided not to do a third edition because high-school (AP) and college/university intro computer science courses in the US moved from C++ to Java in the mid to late 2000s. That probably caused demand for C++ textbooks to plummet. Kind of a pity, because it really wouldn't have taken much work to bring it up to date.
The main problem with the code in this book is that it was written before C++98 compilers were widely available, so it uses Astrachan's own library and header files for strings and vectors. However, the code is compatible with std::string and std::vector, except for using different #include files, e.g.
#include "tstring.h"
instead of #include <string>
. After I installed a new compiler, I simply told students to substitute the standard #include
files for Astrachan's.
Last edited: