I find that when someone asks what is the best way to learn how to program, people usually provide them with references to a bunch texts written by various authors.

However I don't believe many people at all learn to program from books. I find that they are usually faced with a challenge and then use programming as a tool to overcome it.

For example I 'got into' programming because I wanted to start a server for a game I was playing, so I googled and read through the support for that particular server and now I am a employed software engineer, using only the skills I developed (and then further developed) by coding C# scripts for a not very popular server package.

So my question is, do people generally find it easier to learn from these books? I know I have looked at a few of them and found them far too 'dry' to encourage me to finish it.

Here's how I learn, generally speaking:


Buy a book
Don't read it cover to cover but know where everything can be found
Find a pet project to work on
Learn from experience, but use the book as a reference
Where the book fails, there is always google


Note: the third point sometimes comes first.

Edit: To answer the question "Why?"

Google is great to find out how to do something, but it's not great for finding out what you don't know. Why would you ever google "C# delegates," if you didn't first know that C# has a concept called delegates and that it might be useful to solve a problem you're working on?

Also, the signal-to-noise ratio can be a bit high sometimes. If you have a rough idea in your head how something is done then you can easily confirm whether the article you are reading is correct. But if you've no clue... you can end up in a bigger mess.
