Ruby Foo

ruby foo

After three years away from all but the most trivial of noodling with the Ruby programming language, I have become a Ruby Foo (as in Mr. T’s catchphrase, “I pity the foo’!”). I am severely out of practice with Ruby, and with two versions having appeared since I last made a living with Rails, even the act of creating a new project is completely different. Since Ruby is the preferred back-end programming language at Shopify and I am the Platform Evangelist, it’s time for me to “sharpen the saw”.


Luckily for me, I ran into Obie Fernandez at the South by Southwest Interactive conference back in March. We sat down for a coffee and he told me about what was happening with Hashrocket and I told him that I was a hair’s breadth away from joining Shopify.

“I’ve been away from Ruby long enough that I’m probably back at newbie level again,” I told Obie between sips of latte made with overcooked beans. “I did it for a bit at the beginning using IronRuby, but between doing all the C# and PHP and the open source ‘Iron’ languages dying of neglect at Microsoft, I’m severely out of practice. I thinking of joining Shopify, and let’s face it: I don’t want to look like an ignoramus in the presence of rock stars like Tobi, Cody and Edward.”

“Give me your email,” said Obie, “and I can do something to help.” Of course he could – he’s the series editor of Addison-Wesley’s Professional Ruby series of books.

Shortly after South by Southwest, a couple of links to PDF editions appeared in my inbox. Thanks, Obie!

eloquent ruby

The first link was to Eloquent Ruby, Russ Olsen’s guide to speaking idiomatic Ruby and getting the most out of the Ruby programming language. It’s a breezy read, written in the same conversational tone that Olsen used in Design Patterns in Ruby, and the book is broken down into 31 bite-size chapters about a dozen pages in length. Each chapter’s title is some principle for programming eloquent Ruby – the first few are “Write Code That Looks Like Ruby”, “Choose the Right Control Structure” and “Take Advantage of Ruby’s Smart Collections” – and each explains that principle, provides code, shows you where you can find the principles used in actual, working projects. The book straddles the line between tutorial and reference; it’s written in tutorial style, but it’s organized so well that it might as well be a reference for those parts of Ruby that you might not use often (but should) as well as for those parts you keep forgetting (in my case, I always end up having to look up metaprogramming). I’ve been going through it at about a chapter an evening, and I’ve been getting smarter each time. Whether you’re coming back to Ruby after a hiatus like I am or if you just simply want to get better at Ruby, you should have this book in your library.

If you’d like to know more about Eloquent Ruby and its author, Russ Olsen, check out this interview with him at InfoQ.

ruby on rails 3 tutorial

I have yet to properly sink my teeth into Ruby on Rails 3 Tutorial but a quick scan of the book has shown that it’s quite promising, and the Amazon reviews are bolstering my belief.

I’ll be writing from time to time about my return to Ruby and Rails in this “Ruby Foo” series of posts, and I hope that whether you’re new to the language, returning after a break like me or aiming for “guru” status, that you’ll check out this blog regularly for notes on my explorations and what I’ve learned.

This article also appears in the Shopify Technology blog.


Two New Books for Windows Phone 7 Developers

Free Ebook: Programming Windows Phone 7

Cover of "Programming Windows Phone 7"

Charles Petzold literally wrote the book on Windows development, and he’s now doing it for Windows Phone 7. Programming Windows Phone 7 is published by Microsoft Press and covers Windows Phone 7 development from many angles: building apps with Silverlight, making games with XNA and making your programs even better by accessing online services.

Windows Phone is a lot of ground to cover, so the book is sized to match. Petzold’s been working on it since at least the start of the year and it shows – it’s over 1,000 pages on our favourite mobile operating system! Luckily, this book is free-as-in-beer: that’s right, you can download it in ebook form, along with the sample code, for no money at all. If you’re looking to seriously get into Windows Phone 7 development, you should have this book.

Downloads for Programming Windows Phone 7

XNA 4.0 Game Development by Example

Cover of "XNA 4.0 Game Development by Example"

Survey after survey shows that games are the most popular mobile phone apps, and Windows Phone is really good at games, and not just from the user’s point of view. The XNA framework, available to Windows Phone developers, takes Windows Phone 7 beyond mere informational apps – it’s like having an Xbox in your pocket!

XNA is also more than just about Windows Phone – it’s also for developing games for Windows and the Xbox 360. Better still, it lets you target three platforms – desktop, console and phone – with a single codebase and tweaks specifically for each platform. If you want to write games and reach a wide audience, XNA is your ticket.

Packt Publishing’s XNA 4.0 Game Development by Example is a great way to get started with XNA programming. It walks you through the development of four games, each from a different genre:

  • Flood Control, a timed puzzle game where you have to quickly assemble pipes before time runs out and water flows through them
  • Asteroid Belt Assault, a 2-D shooter that classic 80’s arcade gamers will find familiar
  • Robot Rampage, a tank game featuring multi-axis controls, a scrolling world, particle effects and enemy AI
  • Gemstone Hunter, which takes the Platformer Starter Kit to new levels

I just got the book, and have only done the most cursory of scans, but I’ve already picked up a few ideas for how to implement features in my games. If you’re looking to do game development for Windows Phone and beyond, this is a great starter book!

Get XNA 4.0 Game Development by Example

This article also appears in Canadian Developer Connection.


Half Off Manning’s .NET MEAP Ebooks – October 1st Only!

half-off sale

MEAP is short for “Manning Early Access Program”, a way for you to get an advance look at in-progress books by Manning Publications. Today only (Friday, October 1st), Manning’s .NET ebooks are going for half price! And yes, once the book is complete, you also get the final version of the book in ebook form.

Manning’s MEAP ebooks on .NET topics are:

  • ASP.NET 4.0 in Practice
  • Azure in Action
  • C# in Depth, Second Edition
  • Continuous Integration in .NET
  • Dependency Injection in .NET
  • Hello! Silverlight
  • IronRuby in Action
  • Microsoft Entity Framework in Action
  • Multitouch on Windows
  • SharePoint 2010 Site Owner’s Manual
  • SharePoint 2010 Web Parts in Action
  • SharePoint 2010 Workflows in Action
  • SQL Server DMVs in Action
  • Windows PowerShell in Action, Second Edition

All you have to do to get the discount is enter dotd1001 in the Promotion Code box when you check out. Now go get up to speed on some .NET topic and save money!

This article also appears in Canadian Developer Connection.


“Azure in Action” eBook for $15

Cover of "Azure in Action"

For today only (September 26, 2010): Manning is selling the ebook version of Azure in Action for a mere US$15, which converts to CAD$15.36 as of this writing. The ebook is a MEAP book – that’s Manning Early Access Program – which means that it’s an in-progress book. Purchasers of MEAP books get updates and the final version as part of the deal.

To get the deal on Azure in Action, use the discount code dotd0926 in the Promotional Code box when checking out.

This article also appears in Canadian Developer Connection.


Half Off Manning’s SharePoint Books Today (Sept. 22)

Manning's SharePoint books: SharePoint 2010 Site Owner's Manual, SharePoint 2010 Web Parts in Action, SharePoint 2007 Developer's Guide to the Business Data Catalog and SharePoint 2010 Workflows in Action

Today (Wednesday, September 22) Manning’s offering their SharePoint books, in both electronic and dead-tree form, at half price:

Just enter the promo code dotd0922 in the Promotional Code box when you check out at

This article also appears in Canadian Developer Connection.


Get “Silverlight 4 in Action” for Half Price!

silverlight 4 in actionToday only (Friday, September 10, 2010), you can get either a PDF or dead-tree edition of Silverlight 4 in Action for half price! Just enter the discount code dotd0910 in the promotional code box when you check out at Manning Publications’ online store.

Here’s the publisher’s description of the book:

Silverlight gives you entirely new ways to create rich internet applications, and now Silverlight 4 adds many powerful enhancements to the mix.

Silverlight 4 in Action is a comprehensive guide to application building using C#. It goes into action immediately in a thorough introduction. It then follows up with numerous nifty examples to explore flexible layout, control extensibility, the communication and binding models, rich media, animation, and much more.

This book explores practical questions in patterns, testing, and performance optimization throughout. No previous experience with Silverlight is required.

Remember, it’s half price just for today! With the discount, the ebook edition becomes USD$14.99 and the paper book version (which also gives you the ebook edition) drops to USD$24.99.

This article also appears in Canadian Developer Connection.


“HTML5 Up and Running”– Only $9.99 Today!

html5 up and runningWant to get started developing sites and web applications that run on all modern browsers, including the upcoming Internet Explorer 9? You’ll need HTML 5 (along with CSS 3 and JavaScript) and a handy guide like Mark Pilgrim’s new book, HTML5 Up and Running.

If Mark’s name sounds familiar, it’s because he’s written all sorts of great guides, from Dive Into Python to Dive Into Accessibility to Dive into Greasemonkey to Greasemonkey Hacks, and much of his work is available as both for-pay books and free books off his website.

Today and today only (Friday, August 20, 2010), you can get the ebook version (PDF, ePub and mobi) of HTML5 Up and Running for just USD$9.99 (it normally goes for USD$23.99). Just go to the HTML5 Up and Running page in the O’Reilly site, order the ebook and  use the discount code DDHUR when you check out!

(And while you’re at it, take the latest platform preview of the HTML5-ready Internet Explorer 9!)


This article also appears in Canadian Developer Connection.