What's a good intro computer science book?

Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
5 replies · 3K views
Lobos
Messages
11
Reaction score
2
I'm going to be taking a computer science course next semester, what is a good intro computer science book or C++ programming book I can buy?
 
Physics news on Phys.org
Yes, I remember Lippman's C++ Primer as being pretty good in its earlier editions, for earlier versions of C++.

I haven't taught C++ in over ten years so I don't know which textbooks are favored now. One book that I do remember disliking strongly even though it's fairly popular and widely promoted is Deitel and Deitel's C++ How to Program. The first few reviews on Amazon appear to agree with me. My impression from reading it way back when is that it started life as their C How to Program, and they simply "updated" it for C++. Then when the first C++ standard came out in the late 1990s, they took the good new stuff from the standard library (vectors, strings. etc.) and simply tacked them on at the end instead of integrating them into the rest of the text in place of the C-style constructs that they superseded (arrays, char* "strings", etc.). I have no idea how they handle C++11.
 
Tangential point, but very important to a good start:

If you can install applications on the desktop you use, and it is Windows, consider installing cygwin. It allows you to get many different (GNU) free compilers, C++ among them. I think it is a great idea to see a code snippet in a book, take it and run with it. Generally with Visual Studio and .Net there is a considerable learning curve for getting to the point of compiling and running code well - as well as great cost.
VS is a really good product, but not the best tool to cut your teeth on, unless you must learn C# and lambdas. From the getgo.

If you are on Linux or cygwin you are good to go for C, C++, FORTRAN, ADA, Python...
 
I like very much
"Introduction to Programming in Java" by Robert Sedgewick & Kevin Wayne

The 1st chapter is here: http://introcs.cs.princeton.edu/java/home/chapter1.pdf

There is a very good course online using a condensed version of this book with exercises and some solutions, many downloadable programs, etc...
http://introcs.cs.princeton.edu/java/home/

To start programming in Java on a pc, first you have to install a Java programming environment.
http://introcs.cs.princeton.edu/java/windows/

The previous link will install DrJava for beginners. http://drjava.sourceforge.net/