From: james woodyatt <jhw@wetware.com>
To: The Trade <caml-list@inria.fr>
Cc: Ocaml Beginners <ocaml_beginners@yahoogroups.com>
Subject: Re: [Caml-list] static class member....
Date: Wed, 6 Aug 2003 22:20:44 -0700 [thread overview]
Message-ID: <E562066B-C896-11D7-9E0E-000393BA7EBA@wetware.com> (raw)
In-Reply-To: <Pine.LNX.4.44.0308060901130.15452-100000@grace.speakeasy.net>
[please reply to ocaml_beginners@yahoogroups.com]
On Wednesday, Aug 6, 2003, at 09:12 US/Pacific, on the main Ocaml
mailing list, brogoff@speakeasy.net wrote:
>
> As a side advice to the OP, it would be worthwhile to avoid the OOP
> and just
> get used to the ML part of Caml first.
I would strongly second this advice. When I came to Ocaml from C++, I
did not heed this advice-- and I wasted a lot of time learning why that
was a mistake.
In fact, the first piece of advice I would pass along to Java/C++
programmers who are new to Ocaml is this:
+ Don't use classes unless functors and module inclusion fail to
satisfy your requirements.
There are many fine ways to obtain the kinds of relationships in the
Ocaml type system that C++ and Java both only use classes to offer. In
Ocaml, the object class and class type semantic is only one of the ways
to skin a particular kind of cat. It's not, in fact, the most
straightforward one either. Until you understand the tradeoffs for
choosing it, I recommend avoiding it. You can do *almost* everything
with 'functor' and 'include' and/or phantom polymorphic variant type
parameters on abstract types with parameter variance annotations.
That said, the class and class type semantic is an indispensable aspect
of the language, from my point of view. It's just not very easy
explaining why I say that to a newbie.
--
j h woodyatt <jhw@wetware.com>
that's my village calling... no doubt, they want their idiot back.
-------------------
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
next prev parent reply other threads:[~2003-08-07 5:20 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-08-06 12:35 [Caml-list] Unix.kill on Win32 James Scott
2003-08-06 12:57 ` [Caml-list] static class member Vovka
2003-08-06 14:45 ` Richard Jones
2003-08-06 14:51 ` David Brown
2003-08-06 15:10 ` Richard Jones
2003-08-06 16:12 ` brogoff
2003-08-06 17:43 ` Richard Jones
2003-08-06 18:11 ` David Brown
2003-08-06 18:30 ` William Lovas
2003-08-06 18:14 ` Nicolas Cannasse
2003-08-07 0:12 ` Jacques Garrigue
2003-08-07 5:20 ` james woodyatt [this message]
2003-08-07 17:02 ` brogoff
2003-08-07 21:53 ` John Max Skaller
2003-08-06 16:24 ` David Brown
2003-08-07 0:21 ` [Caml-list] Unix.kill on Win32 Jacques Garrigue
2003-08-07 0:41 ` Jacques Garrigue
2003-08-08 14:38 [Caml-list] static class member Arturo Borquez
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=E562066B-C896-11D7-9E0E-000393BA7EBA@wetware.com \
--to=jhw@wetware.com \
--cc=caml-list@inria.fr \
--cc=ocaml_beginners@yahoogroups.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox