From: Glenn Parker Date: 2004-12-30T14:36:23+09:00 Subject: Re: #send and private methods Marc Merlin wrote: > In other words, information hiding is a way of making software systems > resilient in the face of change. It is not simply a way "nanny" > programming languages try to keep "top-gun" programmers from getting their > job done. Except that, if a private function is irrevocably private, it actually *does* occasionally keep top-gun programmers from getting their job done. Information hiding is a good thing, but absolute enforcement of information hiding is not a good thing, at least in Ruby. This probably precludes Ruby from certain applications. The normal Ruby syntax enforces information hiding as you would expect, while using "send" is ugly and it stands out clearly. People that use "send" to subvert information hiding are fully aware that they are breaking the rules and introducing an ugly dependency on a hidden API into their system. Sometimes that is the right tradeoff for a good engineer to make. Why should the creator of the "private" API be the one to decide, once and for all, that this is unacceptable? The creator cannot anticipate every situation that will occur in the future, they can only designate areas of relative instability using "private" and "protected". -- Glenn Parker | glenn.parker-AT-comcast.net |