small medium large xlarge

16 Sep 2011, 07:55
Neil H (1 post)

In Episode 1 Dave says: There is no such thing as class methods in Ruby. Instead all we have are singleton methods that happen to be on class objects

And when you think about it that’s incredibly cool….

Can someone elaborate why this is cool. I feel like I might be missing something fundamental.

He does elaborate a little: There are no special cases for classes. Classes really are just objects, like any other object.

What special cases ARE there usually for classes?

I have to say, brilliant presentation, really well paced and presented, well chosen examples etc. And I am watching this episode before my first caffeine hit of the day, whilst eating cereal - so that is saying something.

01 Feb 2012, 14:08
Dave Thomas (366 posts)

For me, elegance comes when things are reduced to their essentials.

In most languages, dispatch to class methods is a special case. In Ruby, it isn’t. It is simpler. But it also means that things that work for regular methods work for so-called class methods, too. The orthogonality adds power.

You must be logged in to comment