[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Ruby and OO
I'd like to hear more about the practical implications of Ruby's deep
OO. I mean if Ruby internally treats loops and conditionals and scripts
as objects and methods that seems to me to be only a problem if it
causes some confusion or difficulty for the programmer. Reducing the
number of conceptual objects in the inner core of a language is good
unless it makes programming difficult in which case it is bad. If you
write a grotty Perl-style regular expression and then find out that
under the covers it is really OO I see that as a benefit, not a price.
It means that you CAN treat it as an object and do OO things on it if
you want. Or you can (hopefully) ignore the OO-ness of it.
Does anyone complain about CLOS that underneath it all it is really just
"macros and functions"?
Also, I'm not convinced Python is that far off (for better or worse).
You could think of functions in a Python script as methods on the module
object. It's a little painful to get the reference to that object but it
can be done (sys.modules["__main__"]).
I am not a Ruby user myself so I am looking for enlightement on that
issue. I feel that people would not have complained about it if there
were not a deeper issue than just that the manual said that even stuff
that looks non-OO really is.
Paul Prescod