Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

atari1356

macrumors 68000
Original poster
Feb 27, 2004
1,582
32
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

Moderator emeritus
Jun 15, 2000
7,958
7
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

macrumors 68000
Feb 1, 2005
1,887
1
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

macrumors regular
Aug 7, 2006
169
0
KALM
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

macrumors 6502a
Feb 24, 2004
647
0
London, UK
I started programming using the Holy Bible.

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

Moderator emeritus
Jun 25, 2002
16,120
2,397
Lard
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

macrumors member
Aug 12, 2006
35
0
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

macrumors 68000
Original poster
Feb 27, 2004
1,582
32
kainjow said:
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

macrumors 6502a
Mar 29, 2004
888
0
nj
atari1356 said:
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.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.