Live data from Hacker News

The Ruby Stdlib is a Ghetto

mikeperham.com

31–40 of 49 posts

Re: The Ruby Stdlib is a Ghetto

#31
post #27

Hate to sound preachy, but compare to Python developers, who very carefully maintain and update their stdlib. I feel like it is risky to commit to using Ruby for the long-term.

Is that a joke? How many different interfaces are there to popen(3)? How many different ways to get the current time? If Ruby's standard library is a ghetto, Python's is a jungle. If you like Python, I don't know why you'd even think about "committing to Ruby for the long term"; you're a Python dev. They're practically the same language. Stop trying to pick fights.

> How many different interfaces are there to popen(3)?

popen, popen2 - both deprecated. The new "proper" one is available since 2.4 (quite a long time now) - subprocess.

> How many different ways to get the current time?

time.time() Is this that bad? Sure, popen and popen2 are silly, but they're left for compatibility, while subprocess was introduced to update stdlib (as OP claimed). It's hardly a jungle...

Re: The Ruby Stdlib is a Ghetto

#33

Hate to sound preachy, but compare to Python developers, who very carefully maintain and update their stdlib. I feel like it is risky to commit to using Ruby for the long-term.

You could pretty much substitute Ruby for Python in this post and it wouldn't change much. I mean, right down to the http modules being outdated and non-idiomatic (especially urllib and urllib2). I seem to recall reading somewhere that they were written by Guido himself and were some of the first pieces of the python standard library.

Re: The Ruby Stdlib is a Ghetto

#34

I wrote something similar a while ago[0]. Ruby should be the language and everything you "require" should be a Gem. It won't happen with Ruby (and isn't worth the effort). New languages, however, take heed. [0] http://thelincolnshirepoacher.com/pages/standard-libraries

Instead of forcing users to "install file" and "install path," which is bound to cause frustration, you could probably just have an "install stdlib" meta-package. Or at least an "install list stdlib" command that showed people all of the packages to install if they wanted stdlib functionality, which would be completely clear and allow for cherry-picking packages. Or install all packages in stdlib by default and let people remove them if they want.

Re: The Ruby Stdlib is a Ghetto

#35
post #32

Ghetto? How about just "old and crufty"?

It's not 'ghetto' in the slangy adjectival use (e.g., "That coat is so ghetto."), but 'ghetto' in the normal noun use: "The Ruby Stdlib is a Ghetto" (my emphasis).

And if you still think that's hyperbole, it's an allusion to Zed Shaw's infamous "Rails Is A Ghetto" post.

Re: The Ruby Stdlib is a Ghetto

#36
post #30
post #27

Earlier quoted context omitted.

Is that a joke? How many different interfaces are there to popen(3)? How many different ways to get the current time? If Ruby's standard library is a ghetto, Python's is a jungle. If you like Python, I don't know why you'd even think about "committing to Ruby for the long term"; you're a Python dev. They're practically the same language. Stop trying to pick fights.

Yes, there are many interfaces to popen, but that doesn't refute the grandparent, who claims that the Python stdlib is maintained and updated. See the top of http://docs.python.org/library/subprocess.html -- the bad solution was deprecated, and a good solution was created. This is movement towards goodness, which the OP laments the lack of in Ruby.

It's the ciiircle of liiffeee...

Re: The Ruby Stdlib is a Ghetto

#37
post #7
post #5

Earlier quoted context omitted.

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 canonica…

Great 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.

Wasn'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.

Re: The Ruby Stdlib is a Ghetto

#38
post #27

Hate to sound preachy, but compare to Python developers, who very carefully maintain and update their stdlib. I feel like it is risky to commit to using Ruby for the long-term.

Is that a joke? How many different interfaces are there to popen(3)? How many different ways to get the current time? If Ruby's standard library is a ghetto, Python's is a jungle. If you like Python, I don't know why you'd even think about "committing to Ruby for the long term"; you're a Python dev. They're practically the same language. Stop trying to pick fights.

GP is trolling. No need to counter-troll while feeding. The flamebait on committing to Ruby does not invalidate his point on stdlib maintenance though.

We can sit here and ping each other with examples of cruft all day. I think it can be shown objectively that Python's standard library is better maintained. I'll attempt to below.

I'm not saying this has a great significance in picking one language over the other in and of itself. Just that if you want to talk specifically about stdlibs, the differences are pretty clear-cut imo.

== In terms of quantity of updates ==

- Mar 13 2007: Ruby 1.8.6 launched

- May 18 2008: Ruby 1.8.7 launched

- Distance: ~14 months

- Sep 19 2006 Python 2.5 launched

- Oct 18 2008 Python 2.6 launched

- Distance: ~23 months

So discount the amount of 2.5->2.6 changes accordingly to account for the extra time.

Then compare stdlib changes:

- Ruby: http://svn.ruby-lang.org/repos/ruby/tags/v1_8_7/NEWS

- Python: http://docs.python.org/whatsnew/2.6.html#new-and-improved-mo... or http://www.python.org/download/releases/2.6.1/NEWS.txt

== In terms of quality of documentation ==

Compare

http://www.rubydoc.info/docs/ruby-stdlib to http://docs.python.org/library/

You'd need to compare across actual libraries (unittest vs Test/Unit etc). I didn't provide specific examples in links to avoid inevitable accusations of cherry-picking.

== In terms of process ==

Compare http://www.python.org/dev/peps/pep-3108/ to... closest equivalent I could find was http://redmine.ruby-lang.org/projects/roadmap/ruby-19 . Anyone with a better link?

Re: The Ruby Stdlib is a Ghetto

#39
post #32

Ghetto? How about just "old and crufty"?

It's not 'ghetto' in the slangy adjectival use (e.g., "That coat is so ghetto."), but 'ghetto' in the normal noun use: "The Ruby Stdlib is a Ghetto" (my emphasis). And if you still think that's hyperbole, it's an allusion to Zed Shaw's infamous "Rails Is A Ghetto" post.

Good catch. It was indeed a nod to Zed's post.

Re: The Ruby Stdlib is a Ghetto

#40
post #11
post #9

It seems to me the massive "investments" made in mainly web-related frameworks (Rails, Merb, Sinatra + ORMs) didn't help the foundation of the Ruby ecosystem: Take rubygems, take RAA, take the MRI development process. If you got "brainwashed" in the last 5 years about code quality (DRY etc.) + test methods (TDD/BDD) and then look at today's Stdlib, you'll scream and want to put bleach into your eyes… To me it seems t…

The Ruby language specification ( http://www.rubyspec.org/ ), to which all Ruby VMs are written, helps as far as the "number of Ruby interpreters around and their impact" goes. (Assuming I understood your concern correctly.) A new Ruby VM is considered legit if it passes Ruby Spec. That should help in both transparency and compatibility across implementations. Would you agree?

Following your link: "This website is presently being redesigned. We expect to be back soon."

But I knew already that "rubyspec" wasn't a spec in the ordinary sense but a test-suit built with MSpec.

The thing is that real spec actually fully specifies a language - at least up to syntax. There are real specs for Python and Java for instance. The only real spec for Ruby is still crufty Yacc code for MRI.

A test suit doesn't do that and the whole Rubyspec thing is a testimony to people drinking too much of the Test Driven Development Cool Aid. TDD may be fine for some things but some formal design is needed for things like the creation of interpreters.

Part of the challenge is that MRI has such a fluid syntax that specifying it conventionally would be quite hard. But I suspect that's what will have to happen if Ruby's going to go forward.

Post reply on HN