Skip to content
Prev 35001 / 63421 Next

OOP with Encapsulated Class Definitions

On Mon, Nov 23, 2009 at 10:04 AM, Charlotte Maia <maiagx at gmail.com> wrote:
[Warning: this message contains a large number of my opinions of
beauty and aesthetics of OO code, seriously biased by my years as a
perl then a python programmer]

 Wow. That's almost Pythonic in its beauty. I'd considered a system
like this a few years back after looking at S4 OO and having my head
a-splode. I didn't get very far beyond the design stage (certainly
didn't write any code).

 I'm not sure if '.' is a good alias for the object inside methods,
but it's as good as python's 'self' (which is purely convention) or
C++ 'this'', and shouldn't clash with anything, and reminds me of '.'
as the current directory in Unix... Okay, maybe it is a good alias!

 On the downside, good luck getting people using a fourth OO system in
R. Expect messages of the form "I've written 10,000 lines of code in
my package and S4 was good enough for me".

 Can objects have directly accessible attributes, or is every method a
function? In the above, can I do myobject$x = 99 and have it work? If
not, does that imply a raft of getter and setter functions for any
attribute?

 I must install and have a play later this week. I can probably answer
those questions...

+1

Barry