English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
Class/prototype-based OO
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2006-08-25 (07:51)
From: David Baelde <david.baelde@g...>
Subject: Class/prototype-based OO
Hi list,

After having had to learn Java, I was annoyed by the lack of subtyping
compared to OCaml. In Java two identical classes with different names
cannot be used identically. I then re-read Wikipedia's articles on
prototype-based [1] and class-based [2] OO. I used to be convinced
that OCaml was cited in the first category. It is not the case, and I
see now that the question is not trivial.

It is said that prototype-based OO is criticized for being too
dynamic, I believe that OCaml style of OO is an example of static
language having at least the most interesting features of
prototype-based OO.

Any opinion?

If I remember well, I didn't like the duck-typing article either,
which authors didn't seem to know OCaml. Our language makes the
boundary between static and dynamic languages more complex.


[1] http://en.wikipedia.org/wiki/Prototype-based_programming
[2] http://en.wikipedia.org/wiki/Class-based_OOP