Language features, syntax, and gotchas.
Category: Language
Episode #161: Thread Local Variable
Today's episode introduces the concept of thread-local variables, and shows how they can be put to use in an ActiveRecord-like library.
Episode #158: Constant Lookup Scope
This episode takes a look at some potentially surprising rules for how Ruby looks up constants. Notes: "Everything you ever wanted to know about constant lookup in Ruby", by Conrad …
Episode #155: Matching Digits
Today's episode delves into some advanced regular expression features, including "lookahead" and "lookbehind". Notes for further exploration: The book "Programming Ruby 1.9 and 2.0" rubular.com Talks from Nell Shamrell. There …
Episode #147: Atomicity
Today's is another threading episode. This time around, we tackle the subject of "atomicity", and learn about the false assumption at the root of many threading bugs.
Episode #143: Thread Interruptions
In this episode we finally discover why the Timeout module is unsafe, and a facility new in Ruby 2.0 that makes dealing with thread interruptions much less error-prone.
Episode #136: Dead Thread
Concurrent programming is hard, and one of the things that makes it so hard is that a thread can unexpectedly die without giving the programmer any indication. In this episode …
Episode #125: And/Or
Ruby has both symbolic and English forms of the logical "and" and "or" operators. Which one to choose may seem like a matter of taste, but that assumption can get …
Episode #124: Elixir
Today we take a brief sojourn out of Ruby and into the Elixir programming language. I'll show you one of my first programs in Elixir and point out how the …
Episode #110: Catch And Throw
A refactoring episode, showing how to replace exceptions-as-flow-control with the "catch" and "throw" methods.