> I have a more fundamental question: Is inheritence actually useful for > anything? By which I mean, are there real world problems which are > solved elegantly with inheritence which are otherwise difficult to > solve? I'm not sure I've seen many. I have seen many very tortuous > class hierarchies though. >
Some personal thoughts: I think the OO methodology is good for creating reusable components and maintaining a clean interface between them. I develop complex algorithms which consist of many building blocks. Often, I need to try many variants before settling on a final solution, sometimes there is not even any final solution - for each subclass of a problem a different sub blocks might be appropriate. It is a great time-saver if the building blocks can be swapped with as little change in the code as possible. The inheritance is then a convenient way of code reuse. Code reuse is important because it avoids code duplication. And code duplication is bad because it makes maintenance hard. However, I am not using the OO features of Ocaml much, mainly because of the speed penalty. Jan -- ------------------------------------------------------------------------- Jan Kybic <ky...@fel.cvut.cz> tel. +420 2 2435 5721 http://cmp.felk.cvut.cz/~kybic ICQ 200569450 _______________________________________________ Caml-list mailing list. Subscription management: http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list Archives: http://caml.inria.fr Beginner's list: http://groups.yahoo.com/group/ocaml_beginners Bug reports: http://caml.inria.fr/bin/caml-bugs