Have you ever looked at a diff that was cluttered by meaningless "noise" - changes that existed just to satisfy the parser, and were a distraction from the semantic changes …
Category: Freebies
Episode #022: Inline Rescue
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 …
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 …