Thursday, January 06, 2005

More thoughts on debate on getters/setters

Carrying on the discussion from previous. Here's some more thoughts:
1. Property objects. (Each instance variable would be it's own object)
2. Naming accessors with _ so that they look unnatural (not a big fan of this, but I'm trying to get thoughts flowing)
3. Change the language in some way. I don't like the restricting paradigm of java, but how could we change smalltalk. Maybe something more self like where instance variable access and method calls look the same.
4. Development-time method wrappers. Put wrappers in to monitor calls to accessors and warn on non-local access if it has been marked "private". The method wrappers could then be removed at run-time. We have the most dynamic language of all! How can we make it do what we want?!

And that's all I can think of right now. If I think of more, I'll blog them! Wouldn't it be cool to come up with a solution to the getter/setter debate once and for all! =) Of course, it might be like the early vs. late bound language debate and thus, never be solved...But, I think this one can be solved.

No comments: