We all know that Ruby’s built-in HTTP client library is a bit… wonky. As a result, there are a plethora of substitutes for it, each with unique features and boasting their own idea of a good HTTP client API. I’m curious: what HTTP client library do you reach for when you have a choice? And […]
The hacker sits down. It’s been a long time since he worked on this project, so he figures he should probably make sure the tests are passing first.
The string is a stark data structure and everywhere it is passed there is much duplication of process. It is a perfect vehicle for hiding information. — Alan Perlis Here’s a great talk by David Copeland on why and how to avoid making everything a string.
Look, let’s face it: Ruby tools are terrible. If you’ve worked in any Lisp you know what I’m talking about. If you’ve worked in Java or C# anytime recently you know what I’m talking about. If you’ve worked in Haskell you know what I’m talking about. “But Avdi! Lisp is homoiconic, and those other languages are statically […]
Let’s say we’re dispatching events to listener objects. Events look like this: Event = Struct.new(:name, :source, :args) Events should be routed to different handler methods based on the name of the event. For instance, when an object is sent the #call message with an :accepted event: listener.call(Event[:accepted, obj])