Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] ocaml-classes-3.05
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: james woodyatt <jhw@w...>
Subject: Re: [Caml-list] ocaml-classes-3.05
On Monday, Aug 5, 2002, at 17:13 US/Pacific, Jacques Garrigue wrote:
> From: Oleg <oleg_inconnu@myrealbox.com>
>>
>> Jacques, what are the advantages of using the OO wrappers over the
>> corresponding modules from the standard distribution?
>
> None.
> You don't get more features.

Actually... not true.  You get the ability to override the methods by 
inheritance.  In exchange for this feature, you pay a not insignificant 
cost in initialization time and program codespace.  Whether this trade 
is a good one is open to interpretation.

> But it felt strange at the beginning to have an OO languages with no
> basic classes. So I quickly wrote those, and apparently some people
> are using them. They may like the oo syntax, or the customizability.

It felt strange to me at first too.  The feeling eventually passed when 
I fully understood what is really easier to do with classes and class 
types than with modules, signatures and functors.

My advice: Use the most basic syntax the language provides to do the 
basics.  Use objects and methods only when functions (including 
higher-order functions) are insufficient.

--james

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners