Re: But is it Object-Oriented?

Daniel Bonniot <[email protected]>
Newsgroups gmane.comp.lang.nice.general
Message-ID <[email protected]>
>(Progressive disclosure works when we disclose additional information
>that builds on the same initial model. The current Nice story starts
>with the "encapsulated in an object" OO model, and then breaks that
>model to reveal that the only things "encapsulated in an object" are
>fields. That isn't progressive disclosure.)
>  
>
I'm not convinced that the model is broken. It is just extended. That 
is, everything that you could do before, you can still do. There is no 
need to throw away your previous knowledge, it remains valid.

Say we start with Java methods. I can tell you "you know, when you 
override a method, you don't need to keep the same type for the 
parameters, you can actually specialize them. This way, you can handle 
special cases, without having to use instanceof. Keeping the same types 
like you are used to is allowed too, it's just a special case."

We did not break any previous model, we just made it more general.

Similarly, you can then say that methods do not need to be declared 
inside classes, they can as well be defined outside, in which case they 
don't have the implicit 'this' parameter. And it's also possible to 
override an existing method outside of a class.

Again, only generalization. What is true is that at this point you might 
have in your head that there are two types of methods: those inside 
classes, and those outside. But that does not lead to any limitation for 
you. It's a valid model, although there is a slightly simpler one, where 
all mehods are outside classes, and where you can see internal methods 
as syntactic sugar for external methods. When you have understood the 
"mixed" model, this "pure" model should not be very hard to grasp.

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".

>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.

>- expecially when they're
>likely to continue working in other languages.
>  
>
People often need to work with several languages, but they can keep 
track of the differences as long as their are clear enough. A programmer 
familiar with C++ but writting Java code might get upset that he cannot 
use multiple inheritance, but I don't think that would be a reason for 
Java (being younger) to use another name than 'class'. And in Nice the 
problem is even non-existent, because it is generalizing the concepts, 
not restricting them.

Someone who learnt Nice but has to write Java/C++ code might be upset 
because he sees multi-methods would solve his problem nicely, but they 
are not available. That's not something I can do much about, except 
making it as easy as possible to use Nice instead of Java ;-)

Daniel



-------------------------------------------------------
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.