PDA

View Full Version : How to read a programming book?




atari1356
Aug 30, 2006, 10:49 PM
The topic probably sounds silly, but this is something that I've seriously been thinking about today.

For most things, I learn best by doing... by trying things out and discovering how things work on my own. However, most things are much more simple than learning a complex programming language or some framework.

In the past, when I've picked up a programming book I've taken what I felt was the "learn by doing" approach and worked slowly through the book - typing in the examples as I went along, and doing the exercises at the end of each chapter (if there were any). Eventually though I'd get bored or start feeling overwhelmed (*cough* Cocoa/Objective C memory management :rolleyes: :D) - feeling like I'd not made much progress.

Sometimes I'd learn how to do something - but not really understand why it was done that way. It seems to me that to really comprehend a language you should know why things are done a certain way - but as a result, I'd start to get bogged down in the details.

So, now I'm thinking that what I really need to do to make progress is just READ THE BOOK. Skip typing all that code in because it's just slowing me down - and get through the book, even if I don't remember all of the details. I can always go back and read certain parts again to get the details.

I think it may be better to get a general overview of the language - then hopefully the details will fall into place and start to make more sense later on.

What do you think? When you're first learning a programming language do you read through the entire book quickly? or do you work through all of the examples/exercises? I'm interested in other people's thoughts on this... :)



kainjow
Aug 30, 2006, 11:43 PM
From my experience, if I want to learn a new language, I think of a program I want to write, and then work my way through that. I'm learning Ruby (and Rails) at the moment and instead of doing little silly examples, I'm just going to dive into some web apps and start writing them. So I'd suggest you think of something simple and useful you'd like to write, and work on that, while at the same time reading your book and looking up stuff online.

Soulstorm
Aug 31, 2006, 01:13 AM
Studying a programming book is just as if you are reading a mathematics book.

What you will or won't do with this book is up to you. First of all, read the theoretics part very well. That's 50% of the learning process. And try all examples! After that, if you feel that you have understood all the basics of this chapter, you may skip the exercises for this one. But if you feel that this chapter is very important to skip (for example, a chapter about OOP), do every exercises.

The way you will handle the exercises will also be judged by your understanding of the matter. You will start with the most difficult exercise of the chapter. If you can't solve it, try something easier. By going down in the exercise difficulty hierarchy, you are bound to see something that will suit you. Solve that. This will surely provide you with a way of thinking to do the next exercise. And you will continue on from there...

I am the "learning by doing type". I go through all examples, and sometimes I heavily modify them and make them do something else.

Ah, and these little details you mention... These are the most essential part of every programming language. If you miss a detail, you may never know it, and that missed part will surely come out later, giving you headaches, and stalling you from your work for many hours.

FredClausen
Aug 31, 2006, 01:24 AM
When I first got into programming I bought a book, went through every page by reading them, then doing the examples. I learned pretty good, and that created the foundation for my future programming "skills".

Now I learn a new language by first reading the reference documentation, maybe perusing a book, and then I flat just write a program in it. The syntax is so similar between languages that I mainly just look for the differences.

Palad1
Aug 31, 2006, 05:30 AM
I started programming using the Holy Bible (http://cm.bell-labs.com/cm/cs/cbook/).

http://cm.bell-labs.com/cm/cs/cbook/covers/french4.gif

I really like the way it's structured.

Each chapter introduces a new notion, is built around samples, and a bunch of exercises are given at the end of the chapter.

Some chapters refer to previous exercises and build on top of them, that's great because you really feel like someone is actually helping you along while you progress.

bousozoku
Aug 31, 2006, 06:08 AM
I tend to use a couple of different books at the same time.

I find the O'Reilly Nutshell series of books to be great. They give a good description of specific functionality in a way that doesn't end up as a lecture.

I'll pick a small project and run through a book as a reference, skimming any code examples given. Once I've outlined my project in code, I code specific pieces and return to the code examples for verification.

somewhatstunned
Aug 31, 2006, 09:30 PM
In my experience of programming books, Fat is Bad! Sure it's ok as a first pass to introduce you to menus and such. but it's the dense, skinny books that give you the backstory that makes it all make sense.

I'm new to mac programming myself, but I've been programming for many years in Unix and Windows and Java and I am now looking for the dense, skinny book on OSX. A book with challenging exercises is very good.

What is that book? Anybody know?

atari1356
Sep 1, 2006, 08:08 AM
From my experience, if I want to learn a new language, I think of a program I want to write, and then work my way through that. I'm learning Ruby (and Rails) at the moment and instead of doing little silly examples, I'm just going to dive into some web apps and start writing them. So I'd suggest you think of something simple and useful you'd like to write, and work on that, while at the same time reading your book and looking up stuff online.

Ruby/Ruby on Rails is what I'm learning now as well... the web app I want to create will be quite large, but I'll figure out how to break it into smaller chunks to tackle as I'm learning.

I've decided to buy the Second Edition of Agile Web Development with Rails (currently in beta), since the first edition seems just a bit outdated with it's lack of migration info... and using migrations seems so much easier and better than the way it's done in the first edition.

With previous programming languages, I never really had anything in particular that I wanted to create... so lack of motivation was probably part of the problem. I think you're right about needing to find something simple and useful to work on as you're learning.

weg
Sep 2, 2006, 04:38 AM
So, now I'm thinking that what I really need to do to make progress is just READ THE BOOK.

How to read a programming book? Easy.. don't.
Start writing your own applications, probably using short tutorials on the web, and use books only as reference. If you want to learn coding, the only way to do that is hands on.

Fairly
Sep 24, 2006, 06:23 PM
http://cm.bell-labs.com/cm/cs/cbook/covers/french4.gif
Palad1 has the right idea. But don't just read the book - do it too.

Do all the exercises. Every last one.