Other Old but good C++ textbook available for free

  • Thread starter Thread starter jtbell
  • Start date Start date
  • Tags Tags
    C++ Textbook
Click For Summary
The textbook "A Computer Science Tapestry, second edition" by Owen Astrachan, originally published in 1999, is now available online for free after going out of print. The book emphasizes modern C++ features introduced in the 1998 standard, such as the std::vector and std::string classes, while minimizing the use of C-style arrays and pointers until later chapters. This approach allows for a stronger focus on object-oriented programming in introductory courses. The decline in demand for C++ textbooks, particularly after the shift to Java in U.S. high school and college curricula in the mid-2000s, likely contributed to Astrachan's decision not to publish a third edition. Although the book's code was written before widespread availability of C++98 compilers and uses custom libraries, it remains compatible with standard C++ features. The discussion suggests that reviving interest in the book could involve programming competitions using its content as a prize.
jtbell
Staff Emeritus
Science Advisor
Homework Helper
Messages
16,029
Reaction score
7,809
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:

  • 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:
  • Like
  • Love
Likes jedishrfu, harborsparrow, vanhees71 and 4 others
Physics news on Phys.org
Not a lot of takers today. Perhaps we need a programming competition with this book as the prize.
 
Im currently reading mathematics for physicists by Philippe Dennery and André Krzywicki, and I’m understanding most concepts however I think it would be better for me to get a book on complex analysis or calculus to better understand it so I’m not left looking at an equation for an hour trying to figure out what it means. So here comes the split, do I get a complex analysis book? Or a calculus book? I might be able to Borrow a calculus textbook from my math teacher study that for a bit and...

Similar threads

  • · Replies 22 ·
Replies
22
Views
3K
  • · Replies 34 ·
2
Replies
34
Views
8K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 14 ·
Replies
14
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
Replies
5
Views
2K
  • · Replies 118 ·
4
Replies
118
Views
9K
  • · Replies 65 ·
3
Replies
65
Views
7K