4 ms·
Copy: Much of Ruby’s standard library (the set of classes shipped with the Ruby VM itself) is old and crufty. For laughs, go look at the code for some of the c
by chanks 16y ago
Copy:
Much of Ruby’s standard library (the set of classes shipped with the Ruby VM itself) is old and crufty. For laughs, go look at the code for some of the classes that you’ve never used. Chances are it’s from 2000-2003 and doesn’t even look like idiomatic Ruby. I’m wondering what classes should be removed from the standard library or deprecated so that higher quality replacements can take their place.
The canonical example is Ruby’s net/http library. Its performance and API are just terrible. (Side note: how do you know if an API is terrible? If you have to consult the docs even after having used the API for the past 5 years.) But because it’s in the standard library, most people use it as the base for higher-level API abstractions (e.g. httparty, rest-client).
So looking at Ruby’s core RDoc, my suggested list for removal (where removal means move to a rubygem):
Net::*
DRb
REXML
RSS
Rinda
WEBrick
XML
Any others I missed? Will Ruby 1.9.3 or 2.0 get a good spring cleaning or will we have to live with these classes forever?
- n8tron 16y agoGreat comment - I completely agree about REXML. One question for you - what's an example of a http library in another language which you think provides a good API? Personally, I haven't found net/http to be any worse/better when compared to many other standard http libs.
- catch23 16y agoWasn't rexml's original implementation completely replaced in Ruby 1.9, Rubinius, & JRuby? It seems like the only people who might complain about it are those who are still stuck in 1.8 land.
- jasonwatkinspdx 16y agoDrb is a bit unusual and rarely used, but I wonder what his objection is to the API?
- zem 16y agoi was also wondering what he proposed as a replacement for it