Learn to Program (2nd edition) (PragProg)

For this new edition of the best-selling Learn to Program, Chris Pine has taken a good thing and made it even better. First, he used the feedback from hundreds of reader e-mails to update the content and make it even clearer. Second, he updated the examples in the book to use the latest stable version of Ruby, and also to use code that looks more like real-world Ruby code, so that people who have just learned to program will be more familiar with common Ruby techniques.

Chris Pine @chrispine

For this new edition of the best-selling Learn to Program, Chris Pine has taken a good thing and made it even better. First, he used the feedback from hundreds of reader e-mails to update the content and make it even clearer. Second, he updated the examples in the book to use the latest stable version of Ruby, and also to use code that looks more like real-world Ruby code, so that people who have just learned to program will be more familiar with common Ruby techniques.

Not only does the Second Edition now include answers to all of the exercises, it includes them twice. First you’ll find the “how you could do it” answers, using the techniques you’ve learned up to that point in the book. Next you’ll see “how Chris Pine would do it”: answers using more advanced Ruby techniques, to whet your appetite as well as providing sort of a “Rosetta Stone” for more elegant solutions.

This fourth printing of Learn to Program, 2nd edition has been updated for Ruby 2.0.

Computers are everywhere, on every desk, in your iPod, cell phone, and PDA. To live well in the 21st century, you need to know how to make computers do things. And to really make computers do what you want, you have to learn to program.

Fortunately, that’s easier now than ever before. Chris Pine’s book will teach you how to program. You’ll learn to use your computer better, to get it to do what you want it to do. Starting with small, simple one-line programs to calculate your age in seconds, you’ll see how to advance to fully structured, real programs. You’ll learn the same technology used to drive modern dynamic websites and large, professional applications.

It’s now easier to learn to write your own computer software than it has ever been before. Now everyone can learn to write programs for themselves—-no previous experience is necessary. Chris takes a thorough, but light-hearted approach that teaches you how to program with a minimum of fuss or bother.


Chris Pine first discovered the programming language Ruby in early 2001 and immediately began using it to build tools for his day job: programming computer games. After hours, he volunteered with gifted children teaching them advanced mathematics. With Ruby, he began to teach his students programming as well. Once he saw how easily his students learned advanced programming concepts in this environment, he decided to expand his teaching materials into a book. Chris enjoys board games and juggling, and lives with his darling wife and two darling children in darling Oslo, Norway. He is very happy.


  • Full details: Search
  • View this book’s portal and details on how to post errata and suggestions here.

Don’t forget you can get 35% off with your Devtalk discount! Just use the coupon code “devtalk.com" at checkout :+1:

3 Likes

I read the original version of this book and have to say I LOVED it!!

I’ll copy what I said in my ‘Best Way To Learn Ruby and Rails’ blog post:

If you are new to programming, or OOP (object orientated programming) then we’re going to start with the wonderful Learn To Program by Chris Pine.

Learn To Program is a lovely introduction to programming (and OOP) and luckily for us, just so happens to be in Ruby! It also makes you realise you don’t have to be Einstein to be a programmer – I really like how Chris makes the reader feel like anyone can learn, not just the super smart or the super geeky.

This book is essential if you’re new to either programming or OOP, but highly recommended for any relative newcomer – read it just as a motivator if nothing else. It’s short and sweet, and helps you lose the “I don’t think I’ve got a programmer’s brain” mindset as well.

Out of all the books I read, it’s the one that made me feel that I could be a programmer most. Whenever anyone is in any doubt about that, they should read this book - and whenever anybody asks me where to get started in programming, I direct them to this book.

Thank you Chris! :orange_heart:

3 Likes

Is there a way to contact Chris Pine? I was told I can try to do so here.

I’ve had no issues learning anything up until I hit Chapter 7 Flow Control. I was just not prepared at all to handle the examples he wanted us to try. I am noticing not mastering this chapter is having an adverse effects on tackling the rest of the book. I can reread everything up to chapter 7 multiple times, which I have 2x now, and it seems I am still missing something that is required to make the connections the Author wants me to make to progress further in the book. I was wondering if I could speak to him so he could try to fill in the missing chunk of information and add it to his book for the 3rd edition.

1 Like

I’'m not Chris Pine but what is it about Flow Control that you are finding difficult?

You are always welcome to post a question and tag it with this book if you think people familiar with it or the topic may be able to help 
which I’m fairly sure someone here might :smiley:

1 Like

A post was split to a new topic: Not fully understanding the code in the example in “Learn to Program”

The_Exile and I are communicating via email. Thanks!

1 Like

That’s awesome Chris, and welcome to Devtalk :nerd:

I also want to say thank you for your book! It really helped my confidence and there’s one paragraph in particular where you reassure readers by saying it’s ok not remembering stuff, and that you yourself often have to Google things to get refreshed on things.

I think more people need to hear things like that when starting their programming journey. Thank you! :orange_heart:

1 Like