in reply to Re: Language design: direct attribute access and postponed mutators (Perl Vs Python)
in thread Language design: direct attribute access and postponed mutators (Perl Vs Python)

True, but the OP wasn't about hiding private attributes, but about maintaining public attributes.

Once you've exposed an attribute in the API and and external code is accessing it directly, it becomes complicated to realize "a man in the middle" layer functioning as getter and setters.

Classic (a bit contrived) example is an attribute .name which needs at some point to evolve to a getter name() returning a concat of .firstname and .lastname (and probably .middlename) without breaking old code.

Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery FootballPerl is like chess, only without the dice

  • Comment on Re^2: Language design: direct attribute access and postponed mutators (Perl Vs Python)