Good Computer Science & Algorithms Books(s) To Read Before Getting Into Programming?

4,725 views
Skip to first unread message

AahanK

unread,
Oct 16, 2012, 11:57:27 AM10/16/12
to golan...@googlegroups.com
Many a time I've been advised by (good) people to read a computer science book or two (and also on algorithms) before I get into programming (golang or whatever it is) to gain a proper level of understanding as to what I am/will be doing.

I know this is good advise, but it's been extremely hard for me to find the right books to read. Can I get some help here? Any books that you've read as a beginner that've been very helpful to you?

Please advise. Thanks!

Matt Kane's Brain

unread,
Oct 16, 2012, 12:10:34 PM10/16/12
to AahanK, golan...@googlegroups.com
The Stanford free algorithms course lists the following as recommended reading:
Cormen, Leiserson, Rivest, and Stein, Introduction to Algorithms (3rd edition)
Dasgupta, Papadimitriou, and Vazirani, Algorithms
Kleinberg and Tardos, Algorithm Design
Sedgewick and Wayne, Algorithms (4th edition)

Along with these free MIT lecture notes:
http://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-042j-mathematics-for-computer-science-fall-2010/readings/
http://www.cs.princeton.edu/courses/archive/spr10/cos433/mathcs.pdf
> --
>
>



--
matt kane's brain
http://hydrogenproject.com

Miek Gieben

unread,
Oct 16, 2012, 12:13:25 PM10/16/12
to golan...@googlegroups.com
[ Quoting <mkb-prime@hydrogenproject> in "Re: [go-nuts] Good Computer Science..." ]
> The Stanford free algorithms course lists the following as recommended reading:
> Cormen, Leiserson, Rivest, and Stein, Introduction to Algorithms (3rd edition)
> Dasgupta, Papadimitriou, and Vazirani, Algorithms
> Kleinberg and Tardos, Algorithm Design
> Sedgewick and Wayne, Algorithms (4th edition)
>
> Along with these free MIT lecture notes:
> http://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-042j-mathematics-for-computer-science-fall-2010/readings/
> http://www.cs.princeton.edu/courses/archive/spr10/cos433/mathcs.pdf

And of course there is: 'The art of computer programming' from Knuth.

Although you might actually want to study that book instead of just reading it.

grtz Miek
signature.asc

wkharold

unread,
Oct 16, 2012, 12:38:08 PM10/16/12
to golan...@googlegroups.com
The best programming book ever penned by the hand of man is Structure and Interpretation of Computer Programs (http://www.amazon.com/Structure-Interpretation-Computer-Programs-Second/dp/0070004846/ref=sr_1_1?s=books&ie=UTF8&qid=1350404988&sr=1-1&keywords=structure+and+interpretation+of+computer+programs). That book, a good Scheme environment, e.g., http://www.gnu.org/software/mit-scheme, and six to nine months of work will give you a solid foundation. From there you can explore the computer science world to your hearts content.

SCov

unread,
Oct 16, 2012, 2:06:42 PM10/16/12
to golan...@googlegroups.com
"Algorithms + Data Structures = Programs", by Niklaus Wirth is a classic one.

If you actually care about hardware, "Computer Architecture" by John L. Hennessy & David A. Patterson is a must-read.

However, both would require you to use a pencil and paper while reading - they are books, like someone said here before, that need to be "studied".

SCov

unread,
Oct 16, 2012, 2:11:57 PM10/16/12
to golan...@googlegroups.com
Just a clarification: I think most people *should care* about hardware. Althought today, with high-level programming languages that wrap and obscure next to everything and ever-increasing hardware resources at almost everyone's disposal, the interest in such "mundane" topics seems to fade. And, partially, I can see and understand why. But I still smile (in rare instances tbh - depends on what one is working on...) when the fact that I actually know what is happening "under the hood" makes me see things a little bit differently than some programmer that sees a system like a "big black box".

Patrick Higgins

unread,
Oct 16, 2012, 11:37:41 PM10/16/12
to golan...@googlegroups.com, AahanK
On Tuesday, October 16, 2012 10:11:16 AM UTC-6, mkb wrote:
Cormen, Leiserson, Rivest, and Stein, Introduction to Algorithms (3rd edition)

We used this one in my graduate-level algorithms class. It's good if you have a strong math background and like to read proofs for the algorithms you are going to use. If you want a less rigorous/more practical algorithms book, I recommend Skeina's Algorithm Design Manual.

However, I would hold off on an algorithms book for now. The introductory programming class at Caltech just used the K&R "The C Programming Language" and The Mythical Man Month. The latter was much more useful after I had been programming professionally for a year or two. The second course covered data structures, for which Wirth is a good choice as someone else mentioned. For the most part, we all learned by solving programming assignments with a TA to guide and help us. Many of the books weren't even required. We didn't study algorithms formally until we had taken math courses covering graphs, formal languages, combinatorics, and basic computer science theory.

I'm tempted to tell you to just pick up a copy of K&R and learn C. I knew a little BASIC from high school, but I would say that C was really my first language, and I know many others who weren't CS majors who took the introductory class and learned C as their first language. It's a really straightforward book and knowing C is very useful. Your operating system and many of the programs you interact with daily are written in it. If you ever have a hard time compiling something on UNIX, knowing C will come in handy. Even the Go runtime is written in C.

--Patrick

Rory McGuire

unread,
Oct 17, 2012, 4:09:41 AM10/17/12
to golan...@googlegroups.com, AahanK
On Wednesday, 17 October 2012 05:37:42 UTC+2, Patrick Higgins wrote:
I'm tempted to tell you to just pick up a copy of K&R and learn C. 
--Patrick
100% agree, learn C. Or alternatively don't learn C just spend a week or two doing this assignment(partime):
Make you own malloc(), calloc() and free() these should track allocations and on program shutdown should output memory usage and warn of any memory that was not freed.
Make a Hash table using your allocation functions. To test your hash table make a word counter that outputs the number of words and the number of times each word is used

Jump in!

my two cents.

Archos

unread,
Oct 17, 2012, 5:14:44 AM10/17/12
to golan...@googlegroups.com, AahanK

El miércoles, 17 de octubre de 2012 04:37:42 UTC+1, Patrick Higgins escribió:
I'm tempted to tell you to just pick up a copy of K&R and learn C.
 A novice should not use that book, like first book.

"I myself believed that until I started writing this book. You see, "K&R C" is actually riddled with bugs and bad style. Its age is no excuse. These were bugs when they wrote the first printing, and the 42nd printing. I hadn't actually realized just how bad most of the code was in this book and recommended it to many people. After reading through it for just an hour I decided that it needs to be taken down from its pedestal and relegated to history rather than vaunted as state of the art."

http://c.learncodethehardway.org/book/learn-c-the-hard-waych55.html

Udacity has several courses for beginners: http://www.udacity.com/

Antonio Rodrigues

unread,
Oct 17, 2012, 10:31:12 AM10/17/12
to golan...@googlegroups.com
In my case I found this useful: http://en.wikipedia.org/wiki/Data_structures 

Wikipedia has a great tool that allows you to build your own book (Print/Export side option).

Would this help or is it still a bit hard for you?

The idea is just to browse something like a dictionary and know what the words/expressions mean, with the benefit that they usually are hyperlinked. One method is to study a programming language book while searching these concepts and then coding some snippets.

AahanK

unread,
Oct 17, 2012, 10:41:00 AM10/17/12
to golan...@googlegroups.com
Antonio: I was advised to do this...

 
A: Bottom up

1. Learn quantum mechanics. 
2. Learn statistical mechanics. 
3. Learn solid-state physics. 
4. Learn semiconductor device physics. 
5. Learn quantum electronics. 
6. Learn electrical engineering. 
7. Learn switching theory. 
8. Learn computing architecture. 
9. Learn machine language. 
10. Learn assembly language. 
11. Learn a systems language. 

Now you know how a computer works and how to program it. 

B: Top down 

1. Learn geometry (Euclid; basics of theorem proving). 
2. Learn arithmetic. 
3. Learn number theory. 
4. Learn logic. 
5. Learn Boolean algebra. 
6. Learn complexity theory. 
7. Learn type theory. 
8. Learn Lisp. 
9. Learn a systems language. 

Now you know how a computer can be applied to solve problems safely 
and correctly. 

C: Unified - Do A and B both. I suggest option C.

Now that's hard, isn't it? If you have any advise, please do share. Thanks!

Michael Jones

unread,
Oct 17, 2012, 11:08:48 AM10/17/12
to AahanK, golan...@googlegroups.com
AshanK, I think you should consider Rob's comment as poetry more than literal advice.

Think for a moment about a different question, "Is learning the violin a good way to learn to compose music?" It is much like your question ("Is learning Go a good way to learn Programming?") and suggests why you have had so many different kinds of answers:

* Programming, like composing music, is an inventive task. It has rules that are both followed and broken, it has history that is both copied and ignored, it has trends that come and go, and ultimately, it is judged both in abstract (computer science "music theorists") and in performance (users, efficiency, maintainability "audiences.")

* Programs, like sheet music scores, have an intermediate expression. The expression itself makes some programs hard or impossible to write. This is important--the language you use for programming limits the "music" you can make. Thinking of music, for example, imagine putting your finger on the far-left low note key and sliding it as quickly as you can to the far-right highest note. Anyone could do this, it hardly seems a major accomplishment. But the sheet music score for this is such a nightmare to contemplate that the composer contemplating it might give up. (Or not, say, considering the clarinet solo at the beginning of Gershwin's Rhapsody in Blue or people using Go's roundabout way of doing pointer arithmetic.)

* Music and programming have an underlying "truth" in their pure essence. In music ideas including octave, chord, key, transposition, melody, harmony, counterpoint, measure, rhythm, cadence, syncopation are testament to the complexity of subject. The same is true of programming. It is easy to write a program. Anyone can do it. It is genius to invent Quicksort. Only Tony Hoare could do it. Same with Bach and Betovhen.  \\

Rob's answer was a universal one. You want a practical one. Go is fine, but so is every language. If you like the experience (and if you like Sudoku then you will for sure) then you may come to regard every language as just an instrument that gets you closer in some way to the music that you hear in your soul.

Michael

--
 
 



--
Michael T. Jones | Chief Technology Advocate  | m...@google.com |  +1 650-335-5765

AahanK

unread,
Oct 17, 2012, 11:13:17 AM10/17/12
to golan...@googlegroups.com, AahanK
You are right. But Rob's answer also laid out all the subjects I'd every want to read to get deeper and deeper into programming. Don't you think so?

AahanK

unread,
Oct 17, 2012, 11:16:23 AM10/17/12
to golan...@googlegroups.com, AahanK
Michael: And by the way, for now this is what I am planning - quickly browsing through my high school and college mathematics books (I was always good at math, so this is no big deal), read 1 or 2 computer science books to get a rough idea as to how computers and stuff work, and start learning 'Go'.

Skip Tavakkolian

unread,
Oct 17, 2012, 11:20:38 AM10/17/12
to wkharold, golan...@googlegroups.com
SICP is available online: http://mitpress.mit.edu/sicp/full-text/book/book.html
> --
>
>

Greg Ward

unread,
Oct 17, 2012, 10:37:31 PM10/17/12
to AahanK, golan...@googlegroups.com
On 16 October 2012, AahanK said:
> Many a time I've been advised by (good) people to read a computer science
> book or two (and also on algorithms) before I get into programming (golang
> or whatever it is) to gain a proper level of understanding as to what I
> am/will be doing.

IMHO this is bad advice. I don't think those books will mean much
until you have done some programming and made the usual beginner
errors. *Then* read the books so you understand where you went wrong.

BTW I would recommend Python as a first language. Google for "Dive
Into Python"; ISTR that is a tutorial written for first-time
programmers. If Python didn't exist, I think I would recommend Go, but
I'm still pretty new to it. It's taking me a lot longer to learn Go
than it took me to learn Python, FWIW. I would stay far away from PHP;
it will rot your brain. That would be like contracting VD on your
first kiss, to stretch an already painful metaphor. ;-)

Greg

AahanK

unread,
Oct 18, 2012, 9:56:49 AM10/18/12
to golan...@googlegroups.com, AahanK, gr...@gerg.ca
Thanks Greg, yours is one of the most practical advises I've received so far from this AWESOME! community.

It means a lot. Thanks everyone for your advise.

Michael Jones

unread,
Oct 18, 2012, 10:53:08 AM10/18/12
to AahanK, golan...@googlegroups.com, gr...@gerg.ca
Way back when I was learning about programming the available language was BASIC and I wrote hundreds of programs to solve every simple math puzzle I could find or think of. Once I learned about random number generation, I wrote programs to simulate games (forms of solitaire, monopoly, ...) to try various strategies over millions of games. It was a fun way to learn how to use the language and developed a sense that has never left me that otherwise impossible realizations are available from extensive computation.

--
 
 
Message has been deleted

Joubin Houshyar

unread,
Oct 18, 2012, 3:19:48 PM10/18/12
to golan...@googlegroups.com, AahanK

Dan Schmidt

unread,
Oct 18, 2012, 9:51:27 PM10/18/12
to golan...@googlegroups.com, AahanK
Thanks for sharing those links, I played around with Racket and HTDP some last year and found it both fun and helpful.

Joubin Houshyar

unread,
Oct 18, 2012, 10:34:35 PM10/18/12
to golan...@googlegroups.com, AahanK


On Thursday, October 18, 2012 9:51:27 PM UTC-4, Dan Schmidt wrote:
Thanks for sharing those links, I played around with Racket and HTDP some last year and found it both fun and helpful.

My pleasure. Speaking of fun, did you ever try this? http://impromptu.moso.com.au/  

/R

Dan Schmidt

unread,
Oct 18, 2012, 11:16:22 PM10/18/12
to golan...@googlegroups.com, AahanK
No, but it looks awesome, makes me almost want to get a mac. :)

Patrick Higgins

unread,
Oct 19, 2012, 1:51:36 PM10/19/12
to golan...@googlegroups.com, AahanK
On Wednesday, October 17, 2012 3:14:44 AM UTC-6, Archos wrote:

El miércoles, 17 de octubre de 2012 04:37:42 UTC+1, Patrick Higgins escribió:
I'm tempted to tell you to just pick up a copy of K&R and learn C.
 A novice should not use that book, like first book.

You might be right. I actually learned C not by reading K&R but from TAs and professors, all of whom stressed good style. K&R was just on the desk of all the lab computers and was mostly used as a reference for the standard library. A co-worker gave me a copy of his old K&R several years ago and now I can read it. I bet I would have had a hard time reading the code when I was first starting, and would use a different style these days.
Reply all
Reply to author
Forward
0 new messages