From: Jon Harrop <jon@ffconsultancy.com>
To: caml-list@yquem.inria.fr
Subject: Re: [Caml-list] when OO is wrong
Date: Tue, 31 Mar 2009 04:34:50 +0100 [thread overview]
Message-ID: <200903310434.51030.jon@ffconsultancy.com> (raw)
In-Reply-To: <49D187D3.9090108@ens-lyon.org>
On Tuesday 31 March 2009 04:02:43 Martin Jambon wrote:
> Alexy Khrabrov wrote:
> > What is it about FP which makes modeling simpler than OO, conceptually
> > and technically? How can folks summarize their "enlightenment"
> > experiences in this regard?
>
> ...
> Objects and classes tend to be more appropriate than modules and records in
> the following cases:
>
> - self-centric data that can be considered as a "resource", typically for
> IO operations.
> - frequent need to define and use interfaces before implementations.
> - keeping familiar names for functions/methods without requiring
> disambiguation prefixes ("input", "output", "print", "flush", "read",
> "send", etc.)
I'd also add that OCaml's object system is great when you're developing code
and don't want to have to keep type definitions up to date as the code
evolves. For example, I used objects to represent LLVM's state in HLVM.
I also used an object to avoid introducing a huge mutual recursion in Smoke.
--
Dr Jon Harrop, Flying Frog Consultancy Ltd.
http://www.ffconsultancy.com/?e
next prev parent reply other threads:[~2009-03-31 3:28 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-03-30 21:51 Alexy Khrabrov
2009-03-30 21:58 ` [Caml-list] " Raoul Duke
2009-03-31 3:02 ` Martin Jambon
2009-03-31 3:34 ` Jon Harrop [this message]
2009-03-31 15:53 ` Raoul Duke
2009-03-30 22:38 Ed Keith
2009-03-31 3:35 ` Jon Harrop
2009-03-31 7:03 ` Oliver Bandel
2009-03-31 12:21 Ed Keith
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=200903310434.51030.jon@ffconsultancy.com \
--to=jon@ffconsultancy.com \
--cc=caml-list@yquem.inria.fr \
/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