Monthly Archives: December 2011

Stop reading this blog and learn something

Software development is a wonderful field to be a noob in. Perhaps more than any other discipline, there is a wealth of information available for free online–everything from fundamental computer science courses, to the night-by-night learning notes of a master … Continue reading

Posted in Rants | Tagged | 19 Comments

Systems Programming in the Cloud

Tim Bray has an article up about static versus dynamic languages, and why he finds the static ones less annoying for Android programming than for web programming. It’s a good article. Something I’ve noticed over the past few years of … Continue reading

Posted in Uncategorized | 1 Comment

End your OOP Confusion with the Design Pattern Classifier

The Ruby community has seen a renaissance of interest in classic Object-Oriented thinking lately. We’re talking about Presenters, and DCI, and Data Objects. But with these new discussions come new problems. Namely: the dreaded pattern terminology debate. He says it’s a Decorator. … Continue reading

Posted in Humor | Tagged , | 2 Comments

Fancy GitHub Authentication with Omniauth

Configuring Omniauth for GitHub authentication is easy enough. But I needed to optionally add extra permissions to the authentication token. I eventually figured it out, but since I had to piece the steps together from various sources, I thought I’d … Continue reading

Posted in Howto | Tagged , , , , , | 2 Comments

Another Take on Smalltalk-Style Controll Flow (SBPP #6)

The latest Smalltalk-to-Ruby translation in my SBPPRB archive is “Dispatched Interpretation”. It’s one of the bigger ones I’ve tackled so far. I’m not going to go over the whole pattern here; for that you’ll just need to buy a copy … Continue reading

Posted in Smalltalk Best Practice Patterns | Tagged , , , | 2 Comments

Object Oriented Programming Books

A few people have asked for recommendations of good foundational Object Oriented Programming texts. The truth is I’m kind of behind on my formal OOP reading, and some of the early texts I read I wouldn’t recommend. My first proper OOP book was … Continue reading

Posted in Books | Tagged , | 18 Comments

Testing that a block is called

CapnKernul asks: Hey Avdi. How would you test that a method’s provided block is called in RSpec? Would you stub #to_proc (for &block) and mock #call? Typically the way I test that a block is called goes something like this: … Continue reading

Posted in Ruby | Tagged , , | 6 Comments

Defining #method_missing and #respond_to? at the same time

I was reading Eloquent Ruby yesterday morning (buy a copy if you haven’t already), and it got me thinking about one of my “favorite” Ruby gotchas: defining #method_missing without a corresponding #respond_to?. E.g.: class Liar def method_missing(*args) “Oops, I lied” … Continue reading

Posted in Stupid Ruby Tricks | Tagged , , , | 24 Comments