Re: But is it Object-Oriented?
Isaac Gouy <[email protected]>
| Newsgroups | gmane.comp.lang.nice.general |
|---|---|
| Message-ID | <[email protected]> |
> I'm not convinced that the model is broken. I can tell ;-) All I can say is that my experience learning Nice has been very different from what you suppose to be the case. (And contrasts badly with my experience learning Clean. I find pure functional programming quite a challenge to my thinking, and yet I've never felt misled by Clean.) > Say we start with Java methods... We did not break any previous > model, we just made it more general. We've created a fiction that the compiler reveals to be a fiction everytime it flags an ambiguous method. There isn't a way to make sense of compiler error messages using the fiction that Nice is like Java. Been there, done that. > I don't see where we have broken the initial model. We have evolved > it with several steps of "you can do more" and "this is actually a > special case of that". We also took something away. Something quite fundamental to the ordinary view of OO: a class encapsulates methods. This is quite clear: in Nice a 'private' method encapsulated in a class is not 'private' to that class. This is quite clear from other language designs which promote "encapsulated multimethods", for example Half & Half. http://www.cis.ohio-state.edu/~gb/Brew/Publications/HalfNHalf.pdf Note: I'm not suggesting that Nice should use encapsulated multimethods - rather given that we only have multimethods (and functions) in Nice we should avoid misleading newbies with the idea that there are any encapsulated methods in Nice. > >There's no point expecting experienced developers to revise their > >notion of what a class and interface is > Other languages have differing notions of what a class or a method > is. For instance, C++ classes can inherit from several classes while > Java classes cannot. The important thing is that there you can > relate the two, and just remember this difference. I have shown > above that you can do the same between Java methods and Nice methods. And AFAIK in both C++ and Java, a class encapsulates methods - this is one of the few common threads in OO. > And in Nice the problem is even non-existent, because it is > generalizing the concepts, not restricting them. I disagree. In Nice, the class no longer encapsulates methods - that is not a generalization of OO, it's a fundamental departure. best wishes, Isaac __________________________________ Do you Yahoo!? Yahoo! Finance: Get your refund fast by filing online. http://taxes.yahoo.com/filing.html ------------------------------------------------------- SF.Net is sponsored by: Speed Start Your Linux Apps Now. Build and deploy apps & Web services for Linux with a free DVD software kit from IBM. Click Now! http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click