What's the best way to learn how to program

I want to learn how to write computer programs and have started with watching lynda.com videos and going through a couple SitePoint books. I told a friend of mine the other day that it feels like I am just learning how to lace up my shoes when every one else is actually playing baseball. . . any advice for how to best learn Ruby on Rails and if that should even be the first language.

Currently, I am looking at html tutorials, css tutorials and ruby on rails tutorials. My plan is to go through each of these books the next week and move to Ajax on Rails and Build Your Own Ajax Applications. Any good direction would be excellent. Thanks.

I want to learn how to write computer programs and have started with watching lynda.com videos and going through a couple SitePoint books. I told a friend of mine the other day that it feels like I am just learning how to lace up my shoes when every one else is actually playing baseball. . . any advice for how to best learn Ruby on Rails and if that should even be the first language.

Ruby on Rails is not a language, it is a framework. You should not attempt to use the framework until you know Ruby, the language.

Ruby is a reasonable first language, but don't imagine that knowing a language is the same as knowing how to program. To learn a little bit about how to program and a little bit of Ruby, (buy and) read Chris Pine's excellent Learn to Program. After that, you might be ready for Programming Ruby by Dave Thomas (et al.). After that I recommend both Agile Web Development with Rails by Dave Thomas and David Heinemeier Hansson (et al.) and Ruby for Rails by David A. Black.

Currently, I am looking at html tutorials, css tutorials and ruby on rails tutorials. My plan is to go through each of these books the next week and move to Ajax on Rails and Build Your Own Ajax Applications. Any good direction would be excellent. Thanks.

As an aside, I find it distressing when people think they can learn the craft without real training. It's like thinking that you can learn cabinet making by putting together enough Ikea furniture. Anyone can put together Ikea furniture. Anyone can put up a shelf. It takes years of training to learn how to create quality cabinets.

Likewise, it takes years of training to learn how to program well enough to develop a system that doesn't suck. If you want to build furniture or websites as a hobby, go ahead and learn on your own. If you want to be employed as a software engineer, go get a four-year degree in computer science.

There are going to be dozens of responses to this with anecdotes about how someone is doing just fine as a software developer without a computer science degree. If you can do a good job as a software developer without computer science training, more power to you. Imagine how much better you could be with the right training.

Also, if you think you are doing a good job, that doesn't mean you're right. I've worked with many different developers. Some of them were rock stars, some of them were incompetent, and the vast majority were pretty good. All of the rock stars had computer science degrees. None of the incompetents did. The ones in the middle were a mix.

--Greg

@Zak:

Formal training helps. It’s difficult to find a job without at least a 2 year degree + experience… but people manage.

Now, if you’re just learning to program for fun or maybe as a hobby (that’s how I started), I recommend two things…

Ruby is great because it’s simple compared to other languages, but it can get complex. Try http://tryruby.hobix.com/ for a nice interactive Ruby tutorial.

I highly recommend “Learn to Program” by Chris Pine. It’s an excellent book that will teach you programming concepts using Ruby. It’s a great place to start.

If you dig programming and you want to do it for a living, those CS classes that Gregory mentioned will really come in handy. Even then you’ll need experience to make you better.

I’ll never be the best programmer… I have many programmers who are better than me as my mentors and inspirations.