The Ruby Stdlib is a Messy Workshop

Mike picks out Net::HTTP as his prime example saying Its performance and API are just terrible but does not back his performance claims with any benchmarks and does not back up his API claims with any examples. The rest of his libraries fall under “old and crufty” but I’ve heavily used many of the libraries listed and don’t share those experiences.

via The Ruby Stdlib is not a Ghetto.

I have to mostly agree with Eric here. He adequately defends Net::HTTP’s performance. I just want to add that as an API it is also surprisingly complete and robust. Most of the libraries that have attempted to put a more convenient face on HTTP tend to fall flat on their faces when you want to do anything other than the most basic GETs and POSTs. It has separate error classes for all of the standard HTTP errors, making it very easy to handle errors in an idiomatic way. Modeling requests as objects in their own right may not seem like an immediately obvious approach, but it turns out to allow for a quite powerful way of incrementally building up requests. It may not always be the most intuitive library, but it’s rare that you hit on a case where the answer is “oh, we never thought of that use case”. That’s not something I can say of most libraries.