Putting a rescue at the end of a line can get you into unexpected trouble. In this episode we'll look at why, as well as at the one case where …
Category: Freebies

Episode #020: Struct
In previous episodes we've used the Struct class in passing to quickly construct classes. This time, we put Struct in the spotlight, and put it through its paces. You'll want …

Episode #017: Pay it Forward
In this episode, we explore command/query separation by looking at what happens to unit tests when the separation breaks down.

Episode #011: Method and Message
A look at the difference between methods and messages, and why passing methods around isn't as common in Ruby as it is in e.g. JavaScript.

Episode #008: #fetch as an Assertion
Hash#fetch is one of my favorite methods. In this episode, I take a look at using it to assert the existence of hash keys.

Episode #007: Constructors
A look into how Ruby's object construction works, and how we can customize constructors for special scenarios.

Episode #005: Array Literals
Using strings to build up command lines for execution is error-prone and potentially insecure. Check out why Ruby's %W array-literal syntax is the perfect tool for writing, composing, and executing …

Episode #003: Character Literals
Much like a vestigial tail, Ruby has a character literal syntax which is funny-looking and largely useless. In the interests of completeness, let's see if we can find an excuse …