5 Reasons to Hate Ruby

5. Ruby Is Japanese For Perl

Originally created in Japan, Ruby is just a washed out Perl, an ill translation of a language if you will. There’s no $_, $`, $@, $$. There’s no m///, s###, y!!!, tr^^^, no qq, qw, qx, qr. Ruby doesn’t even have $scalars, @arrays or %hashes. How does it expect me to speak a language with nothing but, um, words?!

Though I excuse Ruby, I completely understand its reasons for being weird. It’s Japanese, it can’t use English.

4. Ruby Only Has 38 Keywords

According to Learning Ruby, there’s around 38 of them. Just 38! Even perlfunc documents more, somewhat around 270 functions, and I consider Perl to be a little on the cheap side.

Here’s how a real language’s quick reference should look like. A staggering 4942 functions, not counting class functions, and if you do, you’ll end up with 5312 functions. I don’t even want to know which are built-in, and which are extensions; with 5K functions, I couldn’t care less.

3. Ruby Has No Sense of Humor

Watch:

`$=`;$_=\%!;($_)=/(.)/;$==++$|;($.,$/,$,,$\,$",$;,$^,$#,$~,$*,$:,@%)=(
$!=~/(.)(.).(.)(.)(.)(.)..(.)(.)(.)..(.)......(.)/,$"),$=++;$.++;$.++;
$_++;$_++;($_,$\,$,)=($~.$"."$;$/$%[$?]$_$\$,$:$%[$?]",$"&$~,$#,);$,++
;$,++;$^|=$";`$_$\$,$/$:$;$~$*$%[$?]$.$~$*${#}$%[$?]$;$\$"$^$~$*.>&$=`

Now watch:

print map chr$_[0]-ord$_,@_='200ocT¨gZYT`cV¨xcV\¨`ge]cV'=~m;(\d+|.);g;

Can Ruby do this?

2. Ruby Has No Class

“Class in an object, Object is a class.” Ruby people just love to philosophize.

A Class in Ruby is just an object that can spawn new Objects. Classes can have methods attached to them, but not give these methods to their spawned ones. Objects on the other hand are instances of Class, and have their own methods that Class gave to them.

Not only that, but objects are open and can be overridden. This means that a method can be turned into an object, which then can be used as a block passed to another object, glued to a class, split across more objects, called simultaneously from difference threads, on different servers, redefined, then redefined again, twisted into obedience, bond to a master, and then beaten to death.

I’m not expecting you to understand, I couldn’t either. And Just so you know, capitalization in the quote above does matter.

1. Ruby Makes You Think

With Ruby, you have more than enough rope to shoot yourself in the foot. Good luck trying figuring out Ruby’s dynamicism (or the couple of paragraphs above). Ruby’s flexibility makes it very easy to write code than only you (and God) can understand.

If you want to write proper Ruby, you better understand classes and objects, lambdas, design patterns, mixins, threading, messages, and tons of other funny words, otherwise you’ll end up where you started: writing CMS software in PHP.

Comments (17)

  1. Tom wrote:

    ^_^

    Wednesday, April 18, 2007 at 7:27am #
  2. It sounds like you’re expecting Ruby to be just another scripting language. It’s true that dynamically bound languages such as Ruby do take a certain amount of learning, but all object-oriented languages require you to put in that effort.

    Of course Ruby has arrays and hashes, and they’re even notated in the same manner as Perl: [] and {}, respectively. Read up a bit on some other object-oriented languages such as C++ or Java and I think you’ll begin to see why the type of the referent is more important than than the exact type of the reference.

    Friday, April 20, 2007 at 1:48am #
  3. Preston, I hope you didn’t get me wrong. I fell in love with Ruby, and that dynamism is exactly what tipped the scales.

    Friday, April 20, 2007 at 3:26am #
  4. anon wrote:

    Ruby does have $_, $0, $1, $2, $2 etc.

    Friday, April 20, 2007 at 3:40am #
  5. Lee Preston Nails wrote:

    Preston,

    I think you may have read this with your humor/sarcasm module uninstalled…

    Friday, April 20, 2007 at 5:11am #
  6. Ruby may not be able to use English, but you can require it:

    http://ruby-doc.org/stdlib/libdoc/English/rdoc/index.html

    Friday, April 20, 2007 at 5:12am #
  7. Hey look at that. Thanks for the tip Paul.

    Friday, April 20, 2007 at 5:51am #
  8. ROFL

    puts “Just another ruby hacker”

    Friday, April 20, 2007 at 6:37am #
  9. Craig wrote:

    The reason that there are so few keywords is becasue so much of that functionality is wrapped up as object methods and not as language wide functions.

    Friday, April 20, 2007 at 8:52am #
  10. Ted wrote:

    Class is an object

    Friday, April 20, 2007 at 10:32am #
  11. I didn’t grok the sarcasm.. sorry :)

    Friday, April 20, 2007 at 11:17pm #
  12. Nolan wrote:

    What are you talking about in number 2, Ruby has a lot of klass

    Saturday, April 21, 2007 at 6:40am #
  13. Darren Wang wrote:

    呵呵,或许吧

    Saturday, April 21, 2007 at 12:10pm #
  14. I would love to understand what the above means. Anyone can translate?

    Saturday, April 21, 2007 at 12:29pm #
  15. menneke wrote:

    Rami, here, I solved that for you… ;-)

    Our mark 标 题 non- right one 个 问 phrase. Cause 为 our 已 经 suitable 确 fixed, Ruby ON Rails travelling 企 业 right it is quick 晚 mark circumstance. The 已 经 possession thickly the multi marks 讨 论 围 绕 arrival “business Rails main point it is pleasant some some time” spreading/displaying 开. 但 right, 对 于 企 业 级 super 复 杂 it comes, 说, 开 发 mark 效 ratio merely right one side the surface. Reaching little 还 possession 其 other 几 个 direction right necessary 须 关 note. Non Isao talent characteristic demand seeking, 也 engaging in right 软 case - ilities: Efficiency, 并 发 吞 吐 quantity, Noboru 缩 characteristic, safety, and so on and so on. All-inclusive integral life periodic support: Demand seeking, 设 计, 开 发, management and 质 quantitative preservation of arrangement 证, post, 维 护, sho 级. The 软 case life periodic each 个 环 节 right no possession 适 this mark tool harmony/或 most 实 践 it comes good, 覆 盖. Type 统 adjustment. Giving 遗 stationary type 统 right no talent 够 协 the same construction. 这 Principal body 现 resident in 两 个 direction: (1) news system 统; (2) 遗 residue 据 库. 动 态 语 word on the 实 际 quickly 已 扮 performing 胶 water target angle color in the resident in each 种 企 业 IT 统, one 些 maturity 组 织 it is quick 已 认 识 arriving at 它 们 并 non- stopping right urgent engaging in chapter 拼 凑 软 case method treasure. Main body special point use profitable 它 们 talent of 动 态 语 word 够 the suitable drifting Akira area drawing predicative each 种 领 limits, 这 correct right 为 no Rails on meeting resident in Ruby it comes out merely, 现 mark cause. Reaching 于 front stopping arriving at, 企 业 级 super 复 杂 place watching it is heavy mark three 个 direction. 结 combination Apache, Mongrel harmony HAProxy post design 已 经 suffering 证 discernment possession 轻 pine super 过 duty no J2EE 应 business clothes 务 vessel efficiency harmony 吞 吐 quantity, also 无 享 rack 构 use 其 possession complete 线 sexual horizontal Noboru 缩 ability; Reaching 于 safety, main body engaging in 已 经 构 structure Ryo all-inclusive 备 而 yes of UNIX 靠 mark safe system. On resident in this year RailsConf, our 们 military officer watching arriving at 关 于 “how the post high performance 企 业 级 Rails 应 business 环 boundary” mark 产 item harmony most it is good 实 践. Resident in life periodic direction, our 们 已 经 possession Ryo CruiseControl.rb harmony Capistrano; Our 们 same military officer watching arriving at Mingle formal Akira phase, from here and the basic 于 这 些 tool most it is good 实 践. Type 统 adjustable 或 许 right immediate most preposterous one 个 领 limits: Our 们 possession ActiveMessaging, our 们 possession 复 combination main 键 support and 但 right 很 discernment 显 这 离 arrival “one flight mark 遗 stationary type 统 adjustable” 还 possession suitable spur 离. Resident in future throughout the year, 这 possible right “企 业 级 Rails” most possession watching 头 the mark one 个 领 limits. 总 而 word 之, non- 难 watching arriving at, same flight right 对 于 企 业 级 super 复 杂 mark request and Ruby harmony Rails 也 已 经 做 good Ryo - - reaching little right most - - associate 备. Same flight customer 气 point non- 说 “Rails ratio J2EE 还 main point 适 combination 企 业 use” 这 样 the mark 话, 对 于 那 些 愿 mind acceptance bearing uniformity 风 险 it comes, stopping sho IT 效 ratio 企 业 而 word, right, the Ruby harmony Rails integral equipment 待 发.

    Monday, April 23, 2007 at 3:40pm #
  16. gigix wrote:

    Sorry Rami…that’s a trackback from my blog. Following is what I said in that blog entry:

    To be used in “enterprises”, Ruby has following (major) chanllenges:

    (1) performance/scalability/maintainability…of deployment
    (2) support for overall lifecycle: test, continuous integration, deployment, etc.
    (3) integration with legacy: messaging, legacy databases, etc.

    Fortunately, there are (at least, potential) solutions for all of these challenges. For enterprises willing to take (a little bit) higher risk, Ruby/Rails is already usable.

    Saturday, May 12, 2007 at 7:48pm #
  17. Thanks Gigix, I was starting to get worried. Seems that not everyone likes sarcasm.

    Saturday, May 12, 2007 at 7:57pm #

Trackback/Pingback (1)

  1. Ruby on Rails走向企业 : 透明思考 on Saturday, April 21, 2007 at 8:54am

    […] 我的标题不是一个问句。因为我已经相当确定,Ruby on Rails走向企业是早晚的事情。已经有太多的讨论围绕着“用Rails要快多少多少倍”展开。但是,对于企业级超复杂来说,开发的效率只是一方面。至少还有其他几个方面是必须关注的。非功能性需求,也就是软件的-ilities:性能,并发吞吐量,伸缩性,安全,等等。完整的生命周期支持:需求,设计,开发,配置管理,质量保证,部署,维护,升级。软件生命周期的各个环节是否有适当的工具和/或最佳实践来覆盖。系统整合。与遗留系统是否能够协同工作。这主要体现在两个方面:(1)消息系统;(2)遗留数据库。 实际上动态语言早已在各种企业IT系统中扮演胶水的角色,一些成熟的组织早已认识到它们并不止是急就章拼凑软件的法宝。动态语言本身的特点使得它们能够相当漂亮地描述各种领域,这正是为何Rails只会在Ruby上出现的原因。至于前面提到的、企业级超复杂所看重的三个方面。结合Apache、Mongrel和HAProxy的部署方案已经被证明具有轻松超过任何J2EE应用服务器的性能和吞吐量,无共享架构使其具有完全线性的水平伸缩能力;至于安全性,Unix本身就已经构造了完备而可靠的安全体系。在今年的RailsConf上,我们将看到关于“如何部署高性能企业级Rails应用环境”的产品和最佳实践。在生命周期方面,我们已经有了CruiseControl.rb和Capistrano;我们即将看到Mingle的正式亮相,以及基于这些工具的最佳实践。系统整合或许是目前最不明朗的一个领域:我们有ActiveMessaging,我们有复合主键支持,但是很明显这离着“方便的遗留系统整合”还有相当距离。在未来的一年中,这可能是“企业级Rails”最有看头的一个领域。总而言之,不难看到,即便是对于企业级超复杂的要求,Ruby和Rails也已经做好了——至少是大部分的——准备。即便客气一点不说“Rails比J2EE还要适合企业使用”这样的话,对于那些愿意承担一定风险来提升IT效率的企业而言,是的,Ruby和Rails整装待发。 […]