From: Reimer Behrends Date: 2002-09-06T21:50:47+09:00 Subject: Re: Ruby aesthetics Christian Szegedy (szegedy@nospam.or.uni-bonn.de) wrote: > Reimer Behrends wrote: > > > > However, if we first factored out the functionality of the queue, we can > > now subclass the implementation of the queue separately (the queue > > having no private members), and substitute the new implementation for > > the old one. > > But the queue should have private data since its implementation > is hidden from its interface. If you derive from this quese, then the > hidden data becames visible. If you instanciate it, you generate data, > you can't hide :( If you have an instance of the queue, then it can only be accessed through its public methods. The design decisions are hidden from the class using the queue; yet the queue class itself can be subclassed to be used elsewhere to enhance its functionality. [...] > > As I said, it is largely a religious issue, and this has become much > > longer than I wanted it to be. But there is more to the problem > > than you think. > > I disagree: It is a practical problem. If I can't guarantee name collision, > (and therefore working code), then it is a problem that disturbs me all the > time. It is far from a philosophical or theoretical issue. It is a religious issue because it hinges on methodological assumptions that cannot be validated objectively, but have to be taken on faith. By your methodological assumptions, name collisions are the central problem; by mine, lack of reuse and extensibility is. And there is no way to decide the matter _objectively_. It's largely an article of faith, not of right or wrong. Reimer Behrends