Ruby What do Rubyists like about Ruby?
I put together a totally unscientific gimpy little web poll and posted it to the ruby-talk mailing list, asking Rubyists what their favorite Ruby features are. I received a little over 60 responses. Here are the top 10 (at the time this was posted): Blocks (71%) Lambdas / Procs (57%) Mix-ins / Modules (55%) Open classes / monkeypatching (53%) Duck-typing (53%) First-class regexps (49%) Metaprogramming (49%) Syntactic sugar e.g. val ||= x; array <<> Optional parens / English-like readability (44%) Object#method_missing (42%) There's no real surprises here. Rubyists love their blocks, but perhaps even more than that, Rubyists love closures. Talking to some other people about lambdas / procs being so high, the general sentiment was that they were a feature which was used somewhat infrequently but was very handy when needed. The mixin approach to inheritance is also quite popular. This lies alongside open classes and monkeypatching. Rubyists really seem to enjoy the ability to manipulate code inside the runtime environment, and we also see metaprogramming not too far down the list. First class regexps have always been one of my favorites and I was glad to see they fared well. Beyond that, the type system, syntactic sugar, and method_missing were also popular.
共收到 7 条回复