Tag Archives: books

Since my last post here, I've started working at a software start-up. Its product is a platform for educational iOS apps. As a result, I've gained a decent familiarity with objective C and Cocoa. I haven't had a chance to learn much ruby since starting there, but it's been a good experience for me on the whole.

Before I started I was working through a fantastic book by Topher Cyll, called Practical Ruby Projects: Ideas for the Eclectic Programmer. It's got all kinds of cool things from musical composition to genetic algorithms, and each chapter is genuinely interesting in its own right, independent from anything it teaches about Ruby.

Code starts at 2m27s, MacRuby part at 3m, and game at 9m40s

I should offer a warning, though. The publishers lied when it comes to the difficulty of the book! It's way the heck harder than a followup for "anyone who has mastered the basics of ruby". I attempted to tackle it right after an introductory book and it was very challenging. Progress was slow, and it's only the extreme interestingness of the material that has kept me going. I did parts of various chapters and the only one that I fully finished was for a text-based game he called Dinowars.

The next chapter in the book was on how to use RubyCocoa to make a native Mac front end for the game. Initially I skipped the chapter because I didn't have a Mac and I found all the Cocoa stuff alien. But when I returned to it last week, the material was much more understandable! I leapt in immediately! Not only that, but I decided to delve into MacRuby (an even more compelling technology for anyone who wants to use Ruby to build Cocoa), and I've successfully converted Dinowars' front-end to MacRuby.

This video goes over some MacRuby basics, includes a one page program that pops up a window and reads text with a voice synthesizer, and then shows the final result of my Dinowars port.


Planet cute tiles: Danc's Miraculously Flexible Game Prototyping Tiles
Source Code from the book publisher: Apress
My source code files: tryrc.rb, trymr.rb, trymr2.rb, and mrstrat.rb.

I think the best introductory book to programming that I've ever seen is Learn to Program, by Chris Pine.  My buddy I was staying with last summer went through it while I was there and made absolutely fantastic progress.  Despite never having programmed before, really, he tore through it in a week or two and got enough out of it to start programming simple scripts to help with his research job.

The entire book is taught in Ruby, but I don't think the language used matters that much.  The thing is it teaches concepts basic to almost any kind of programming -- functions, classes, recursion, blocks, etc...   And more importantly, it makes them fun!  Even the very simple exercises, such as "deaf Grandma" and "angry boss" were amusing.  My friend has ended up working almost entirely with Python, but everything in the book was still useful and there was little pain in switching to a new language compared to the difficulty of getting started.

When I first got curious about Ruby myself three years ago, I tried the Pick-axe book and gave up out of boredom.  It really could have used regular programming challenges or problems at throughout the book.  Unfortunately almost all the other resources that were around at the time were focused on Rails.  I really wish I'd found this book back then.

Some free online lessons that later became part of the book can be found here: http://pine.fm/LearnToProgram/