Tuesday, March 3, 2009

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):
  1. Blocks (71%)
  2. Lambdas / Procs (57%)
  3. Mix-ins / Modules (55%)
  4. Open classes / monkeypatching (53%)
  5. Duck-typing (53%)
  6. First-class regexps (49%)
  7. Metaprogramming (49%)
  8. Syntactic sugar e.g. val ||= x; array <<>
  9. Optional parens / English-like readability (44%)
  10. 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.

I've left the poll open if you'd still like to vote:

  • Creating Domain Specific Languages
  • Ternary expressions e.g. foo ? bar : baz
  • Object#class / Object#is_a?
  • Object#method(s) / Module#instance_method(s)
  • Reflection
  • Lambdas / procs
  • Mix-ins / Modules
  • Object#instance_eval / Object#instance_exec
  • Redefining the behavior of core types
  • Standard library (and its use of blocks)
  • Instance-specific behavior / metaclasses
  • First class regexps
  • Optional parens / English-like readability
  • Definable MyObject#method=
  • Module#module_eval / Module#class_eval
  • Use of operators by core types (e.g. Array#*)
  • Object#method_missing
  • Operator overloading (in novel ways)
  • RubyGems
  • Open classes / monkeypatching
  • Syntactic sugar e.g. val ||= x; array << val
  • Code in class body (and metaprogramming with it)
  • Duck typing
  • Enumerators (Ruby 1.8.7+/Ruby 1.9)
  • Embedding code in strings with "#{mycode}"
  • Definable MyObject#[] and MyObject#[]=
  • Enumerable
  • Blocks
  • Singleton classes
  • Module#define_method
  • Splats e.g. method(*args)
  • ObjectSpace
  • Metaprogramming
  • Object#instance_variable_get / Object#instance_variable_set
  • Continuations e.g. callcc
  • MyObject#method? and MyObject#method! idiom

11 comments:

Eltiare said...

I was going to actually take your poll, and then I realized that I would check almost every one of the boxes! I <3 Ruby.

Prateek Barn said...

avriq
avriq India

mariablack said...

Pc Optimization
Windows Installation
Data Recovery

shabnam praveen said...

Call girls in Kolkata
Call girls in Chandigarh
Call girls in Chandigarh
Call girls in Gurgaon
Call girls in Chandigarh
Call girls in Chandigarh

shabnam praveen said...

Call girls in Lucknow
Call girls in Guwahati
Call girls in Mumbai
Call girls in Jaipur
Call girls in Jaipur
Call girls in Jaipur
Call girls in Bangalore

Ruth Sloan said...

waoooo Sooo Niceeee. I really like it. shadow fight 3 mod apk hitman sniper apk geometry dash mod apk

mohit sona said...

nice post thanks
ivanka hot pics

ahmed said...

السيارات الهيدروكربونية الكلورية :
وهي عبارة عن مادة متبلورة شاغرة من أي شوائب ومن أشهر أمثلتها مادة DDT، وتمتاز بعدة مميزات أهمها:

غير قابلة للذوبان في الماء.
ثابتة التكوين وغير قابلة للتحول.
فرصة استعماله كمعلق مائي. قابلة للذوبان في الزيوت البترولية والزيوت النباتية وغيرها من المذيبات العضوية.شركة مكافحة الصراصير

Unknown said...

Thanks for sharing, nice post! Post really provice useful information!

Hương Lâm chuyên cung cấp bán máy photocopy và dịch vụ cho thuê máy photocopy giá rẻ, uy tín TP.HCM với dòng máy photocopy toshiba và dòng máy photocopy ricoh uy tín, giá rẻ.

Nannie Co Pam said...

IEEE Project Domain management in software engineering is distinct from traditional project deveopment in that software projects have a unique lifecycle process that requires multiple rounds of testing, updating, and faculty feedback. A IEEE Domain project Final Year Projects for CSE system development life cycle is essentially a phased project model that defines the organizational constraints of a large-scale systems project. The methods used in a IEEE DOmain Project systems development life cycle strategy Project Centers in Chennai For CSE provide clearly defined phases of work to plan, design, test, deploy, and maintain information systems.


This is enough for me. I want to write software that anyone can use, and virtually everyone who has an internet connected device with a screen can use apps written in JavaScript. JavaScript Training in Chennai JavaScript was used for little more than mouse hover animations and little calculations to make static websites feel more interactive. Let’s assume 90% of all websites using JavaScript use it in a trivial way. That still leaves 150 million substantial JavaScript Training in Chennai JavaScript applications.

angelisaka97 said...

Permainan poker pastinya banyak di kalangan remaja hingga dewasa yang sangat menggemari permainan poker, apalagi dalam 1 id game ada banyak permainan kartunya silahkan kunjungi situs kami untuk merasakan kenyamanan dalam bermain.

poker deposit pulsa

idn poker deposit pulsa

idn poker deposit pakai pulsa

cara deposit poker pakai pulsa

cara deposit idn poker pakai pulsa


download poker IDNPLAY

download idn poker versi 2.1.0

idn poker apk versi terbaru

idn poker apk versi 2.1.0

aplikasi idn poker versi 2.1.0


cara login poker idnplay

cara login idnplay

cara login IDN Poker

link login idn poker

link login idn play

link login poker idnplay

cara masuk akun IDNPLAY

cara masuk akun poker


download idn poker apk 77

cara download aplikasi poker

cara download apk idn poker

cara download idn poker 77

cara download idn poker apk

aplikasi judi kartu

judi kartu online


aplikasi idn poker

apk idn poker