in reply to Does one encapsulate a class from itself?

On the other hand, I've got many, MANY operations to do, and adding a few million subroutine calls slows things down significantly (but not insufferably).

Did you measure it?

  • Comment on Re: Does one encapsulate a class from itself?

Replies are listed 'Best First'.
Re^2: Does one encapsulate a class from itself?
by amarquis (Curate) on Mar 06, 2008 at 19:39 UTC

    Yes. I do not remember the exact results, but I expected a noticeable difference since each get/set does data validation (since my accessors are part of the external interface, they have to make sure everything coming in is kosher. The module itself already knows it has "good" data and can just push it into the array, or update a cell).

    I could fix this by having internal only accessors, like ikegami mentions. I'll try it and see if the difference is measurable.