From: Eleanor McHugh Date: 2009-02-02T23:50:47+09:00 Subject: Re: Its a Free Language On 1 Feb 2009, at 11:54, David A. Black wrote: > Hi -- > On Sun, 1 Feb 2009, Sean O'Halpin wrote: >> On Sat, Jan 31, 2009 at 11:00 PM, Mike Stephens >> wrote: >>> An attractive aspect of Ruby is how it is usually presented as >>> agnostic >>> - you can use it in an object oriented style or you can choose >>> functional or procedural styles. So if you like to think in terms of >>> procedures instead of objects you can still sit at the same tables >>> as >>> other Ruby programmers. Having said that, I would guess that any >>> procedure can be re-represented in terms of objects and your >>> thinking >>> should move in that direction over time to align with the essence >>> of the >>> language. >>> >> >> The power of Ruby does not come from its object-orientation alone - >> how many times do we really use polymorphism or inheritance? Yet I >> bet >> most of us use #select, #map, blocks and literal regular expressions >> in almost every program we write. I certainly do. > > At the same time, though, I'd say that object orientation per se > doesn't depend on polymorphism and inheritance. To me it's the > convergence back onto the sending-msgs-to-objects paradigm that's at > the heart of it (though I don't put that forth as a CS-ly correct > characterization, just my sense of it). I like to think of Ruby as being the English of programming languages. It's got a large and flexible vocabulary that makes it very powerful to work with, but unlike Perl or Lisp or C it's also a very easy language to get to grips with. I'm particularly keen on the loose and pragmatic approach to OO. Being able to open classes and objects at will makes it very easy to specialise them for a specific project. And as for inheritance hierarchies, there's much less pressure to build these rigid and gargantuan frameworks than in certain mainstream languages. As for the functional aspect, I tend to even forget I'm using a functional style because message sending is so pervasive that chaining higher-order functions is the obvious way to solve many problems. Oh, and best of all Ruby's fun to code in :) Ellie Eleanor McHugh Games With Brains http://slides.games-with-brains.net ---- raise ArgumentError unless @reality.responds_to? :reason