Ignore this post. I bit on an April fools joke that I read on April 6th. Way to pay attention. Anyway, the only valid point here is related to send, but that’s hardly a big deal.
I’ve come to absolutely love Ruby. I just love the syntax. But lately I’ve been reading a bit about Ruby 1.9, and it makes me a little worried about Ruby’s (and Rails’) future.
Here are a few of the methods being removed in Ruby 1.9:
method_missing—Yep, that’s right. No moremethod_missing. This is disastrous for Rails, as well as a good chunk of meta-programming practices. The argument is the same as it always is, too much abuse. But the dynamism of things likemethod_missingis what makes Ruby so exciting (and challenging), IMHO.const_missing—Maybe not quite as important, butconst_missingis getting removed for the same reason: too much abuse. I’ll admit, I’ve not used this one too much, but I’ve read about a few clever ways people are using it (unicode-based character escapes, for example).send—And finally,sendwill no longer be available in Ruby 1.9. While there are more important things to worry about (see both bullets above), this is still something to deal with. I’m usingsendall over the place in all of my projects. TheAR::Base.send(:include, RPH::Module)pattern is a commonality that can be found in most plugins. I believe there’s a drop-in replacement forsend(I can’t remember what it is), so a quick fix would be to create an alias method (send) for the newly named version.
They say it takes 10 years or so to learn a programming language. Applying that logic to Ruby, I’m only 20% of the way there. So maybe these changes won’t hurt Ruby. Maybe they’ll be better for the language. I don’t really know. I’m a far cry from a language designer. But man, I’m having a rough time finding the positive with getting rid of method_missing and const_missing. Only time will tell, I suppose.
Maybe it’s time to see what advances PHP has made? Just kidding. Ruby had me at “Hello World”.
01
Simon on Mon Apr 07 at 04:10AM
I’ve spent a bit of time googling this, but just wondering where you found out about each of those points—are these definitely being removed? (Or are they just not implemented yet…)
02
_eric on Mon Apr 07 at 05:04AM
I can’t seem to find any of these in http://eigenclass.org/hiki.rb?Changes+in+Ruby+1.9
Where did you hear about these being removed?
03
DHH on Mon Apr 07 at 06:44AM
The removal of method_missing and const_missing as an April Fool’s joke by someone. The removal of send is actually not a removal, but some syntactic vinegar. You can now do the same using send!.
So no cause for alarm or fear ;)
04
_eric on Mon Apr 07 at 06:55AM
I was actually going to ask if this post was some sort of late April Fools joke. ;-)
05
Ryan on Mon Apr 07 at 07:14AM
I should have known.
I just went back and tried to find the original post, and it was gone. Since I knew it was in Google Reader somewhere, I scoured my ruby/rails feeds until I found it. Of course, the date is April 1, 2007. I read my feeds every 3-4 days anymore, so the dates are a little irrelevant to me. Plus, April fools really plays no part in my life, so I don’t always think about it.
Anyway, the link no longer exists (of course), but here’s the post that made me bite (courtesy of Chris Shea):
I should know better than to trust anything in the beginning of April. I should also know better than to believe
method_missingwas being taken away from Ruby!Sorry for continuing the nonsense…