From: "David A. Black" Date: 2009-01-09T22:30:56+09:00 Subject: Re: How Ruby Hi -- On Fri, 9 Jan 2009, Tom Cloyd wrote: > Thanks Mike. I appreciated your post. I'm an awful Ruby programmer, and write > tightly organized, well documented procedural Ruby. I'm only now, after > probably 1.5 years of on and off work in the language, getting around to > writing classes. I really couldn't see why I'd want to, until very recently. > Then, thanks to some folks on this list, I "got it". I can't wait to dive in > to using classes, now. Dave Thomas issued a challenge in a recent keynote address, where he suggested that when each of us writes our next Ruby program, we try to do it without writing any classes. It's an artificial exercise, of course, but it keeps the focus on the objects as opposed to the class hierarchy, which is all to the good in most cases. When I teach the Ruby language, I actually illustrate singleton methods before I talk about classes, because I consider the dynamism of objects (their independence from their classes) to be a more important foundational principle of Ruby than the fact that every object is an instance of a class. Mind you, like everyone else I write "class Thing" more often than "def thing.something" in my own code (I think :-) But it's still important, in my view, to get the hang of the fact that Ruby classes are not the center of gravity. So it sounds like you've done it in the right order :-) Keep modules in mind, too. They're very cool, especially when you #extend objects with them.... David -- David A. Black / Ruby Power and Light, LLC Ruby/Rails consulting & training: http://www.rubypal.com Coming in 2009: The Well-Grounded Rubyist (http://manning.com/black2) http://www.wishsight.com => Independent, social wishlist management!