From: Richard J. <ri...@an...> - 2003-10-06 20:52:57
|
On Mon, Oct 06, 2003 at 09:42:09PM +0200, Nicolas Cannasse wrote: > BTW, objects are certainly the worst part of OCaml. They are tricky, > difficult to use, and have bad performances (compared to modules instances). > If you look at Java programmers (or most of the OO programmers actually) > they're using OO only for prototyping ( interfaces in Java or pure virtual > classes in C++ ). In Ocaml , you can already prototype by using a module and > add specialisation with some polymorphic closures. Believe me : you don't > need objects. Unfortunately objects have a certain very large mindshare over simple abstract data types. I'm not sure most commercial Java programmers would even know what an ADT was ... In OCaml objects have a major syntactic advantage, in as much as it's easier and nicer to type: hash#find "foo" vs. Hashtbl.find hash "foo" Shame that OCaml doesn't have some syntactic sugar to solve this. Rich. -- Richard Jones. http://www.annexia.org/ http://freshmeat.net/users/rwmj Merjis Ltd. http://www.merjis.com/ - all your business data are belong to you. NET::FTPSERVER is a full-featured, secure, configurable, database-backed FTP server written in Perl: http://www.annexia.org/freeware/netftpserver/ |