Today I had reason to verify the exact semantics of ActiveSupport’s Object#try extension for an upcoming RubyTapas episode. #try is usually used to paper over nil values. Unfortunately, #try does more than this, and as a result it can easily hide defects. Consider: we have a variable with a number in it. We want to […]
A few weeks back I asked what ruby HTTP client library folks preferred. I’ve since collected over 700 responses, which seems like a pretty decent sample. You can check out the results for yourself, or look at the full list of responses, but here are some highlights. And the winner is…
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.