From: Martin Jambon <martin.jambon@ens-lyon.org>
To: Alexy Khrabrov <deliverable@gmail.com>
Cc: OCaml <caml-list@inria.fr>
Subject: Re: [Caml-list] when OO is wrong
Date: Tue, 31 Mar 2009 05:02:43 +0200 [thread overview]
Message-ID: <49D187D3.9090108@ens-lyon.org> (raw)
In-Reply-To: <0DEB4DD9-13C5-4CC5-A916-A18BB6B9DAEB@gmail.com>
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?
OO is not dirty. Wait until you feel it's the right time and do it safely ;-)
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.)
Martin
--
http://mjambon.com/
next prev parent reply other threads:[~2009-03-31 3:06 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 [this message]
2009-03-31 3:34 ` Jon Harrop
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=49D187D3.9090108@ens-lyon.org \
--to=martin.jambon@ens-lyon.org \
--cc=caml-list@inria.fr \
--cc=deliverable@gmail.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