* Jonathan Rockway <[email protected]> [2009-02-19 20:20]:
> In general, whenever Java does something, you actually want the
> opposite.

The Perl way is no better.

What you really want is to make sure that people can get at
innards if they are deliberately trying to, but will stay off
each others’ toes as long as they’re doing their own thing.

Java overdoes it by going to one extreme, Perl by going to the
other.

Or at least the naïve Perl approaches overdo it. It wouldn’t be
Perl if you couldn’t fix it, and you can by using package scalars
to store private methods and package hashes to store inside-out
object fields. That way, things actually get namespaced, so you
don’t have to check all your sub- and superclasses to make sure
your private methods and instance fields don’t override or clash
with (respectively) theirs. A great bonus is that while messing
around in an object’s internals outside your own package is easy
to do, there’s some pretty repulsive syntactic salt associated
with it – as it should be.

Regards,
-- 
Aristotle Pagaltzis // <http://plasmasturm.org/>

Reply via email to