From: Jon Harrop <jon@ffconsultancy.com>
To: caml-list@yquem.inria.fr
Subject: Re: [Caml-list] Some Clarifications
Date: Wed, 27 Jul 2005 11:58:09 +0100 [thread overview]
Message-ID: <200507271158.09619.jon@ffconsultancy.com> (raw)
In-Reply-To: <6C6555DF5D075A4EA6D27706F4EC5975031677D4@EUR-MSG-10.europe.corp.microsoft.com>
On Wednesday 27 July 2005 10:38, Don Syme wrote:
> For what it's worth, I found your posts genuinely interesting.
I think there is something of interest worth discussing but most of it would
be more appropriate on c.l.functional than here. I'd be happy to discuss this
there.
Just replying to the OPs OCaml-related comments: I don't think that most
programmers use OO because it is the right tool for the job. I think they use
it either because it is forced upon them (Java) or because the language fails
to provide alternatives (C++).
OCaml is a useful case study here because it provides many alternatives.
You're not going to implement a closure via an object (as you would in C++)
or a 3D vector via an object (as you would in Java), for example. So it is
instructive to look at uses of OO in OCaml code.
Of the OCaml code which I have studied, the OCaml compilers make scarce use of
objects, the stdlib makes no use (IIRC), the third party data structures and
algorithms that I use also make no use of OO but lablgtk uses OO and I have
one friend who has tried using OO in his own OCaml work.
In my code, I have used an object once, in order to circumvent a typing
problem. I have never successfully used OO in OCaml.
From my point of view, it is interesting to compare graphics and GUI code
which I have written in a classical FP style to a friend's who chose the OO
approach because GUI code is a pedagogical example of OO design. Although it
is early days, I see no evidence that OO is any better than the classical FP
approach at this task.
> Part of what I think accounts for the popularity of OO in the real world is
> that it allows you to program in a very sloppy way in the early stages of
> development without blowing your ability to muck with the way things
> interact, and alter their behavior later in the development process.
> Ideally, it allows you to build big, sloppy, poorly planned systems that
> are nevertheless manageable to maintain.
My experience is exactly the opposite. I worked on a project for several years
which was written in C++ and which used OO extensively. Ultimately, we
ditched both C++ and OO in favour of OCaml and FP precisely because we wanted
to make a few fundamental changes and those changes were simply too difficult
for us to make successfully. In contrast, we have made many similarly
complicated fundamental changes to the OCaml code with no problems.
So, despite reasonable understanding and planning beforehand, OO completely
failed to allow us to maintain and develop the program.
> I find that the facilities of a language like OCaml are so inadequate to
> represent this domain, that using OCaml can be a distinct impediment.
If you would like to discuss OCaml-related stuff then I'd like to hear more:
specifically what it is you're working on, what you have tried and failed to
do in OCaml and why you think OCaml is "so inadequate"?
--
Dr Jon D Harrop, Flying Frog Consultancy Ltd.
Objective CAML for Scientists
http://www.ffconsultancy.com/products/ocaml_for_scientists
next prev parent reply other threads:[~2005-07-27 11:00 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-07-27 9:38 Don Syme
2005-07-27 10:58 ` Jon Harrop [this message]
2005-07-27 11:55 ` Robert Roessler
2005-07-27 14:01 ` Richard Jones
2005-07-28 0:29 ` Robert Roessler
2005-07-27 18:42 ` skaller
2005-07-27 13:36 ` David Thomas
2005-07-27 13:53 ` Ville-Pertti Keinonen
2005-07-27 16:23 ` james woodyatt
-- strict thread matches above, loose matches on Subject: below --
2005-07-27 14:32 David Thomas
2005-07-14 18:00 (Mostly) Functional Design? Kyle Consalus
2005-07-18 7:59 ` [Caml-list] " Robert Morelli
2005-07-19 20:14 ` Some Clarifications Robert Morelli
2005-07-20 6:18 ` [Caml-list] " Ville-Pertti Keinonen
2005-07-24 0:04 ` Robert Morelli
2005-07-24 2:30 ` Paul Snively
2005-07-24 7:37 ` Alex Baretta
2005-07-24 8:08 ` Robert Morelli
2005-07-24 12:23 ` David Teller
2005-07-24 18:29 ` skaller
2005-07-24 18:51 ` Paul Snively
2005-07-24 12:42 ` Gerd Stolpmann
2005-07-25 7:23 ` Ville-Pertti Keinonen
2005-07-20 7:34 ` David MENTRE
2005-07-27 15:37 ` Robert Morelli
2005-07-27 20:33 ` skaller
2005-07-27 23:48 ` Paul Snively
2005-07-20 16:28 ` Damien Doligez
2005-07-24 14:51 ` Robert Morelli
2005-07-24 16:11 ` David MENTRE
2005-07-25 12:21 ` Damien Doligez
2005-07-25 15:47 ` Richard Jones
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=200507271158.09619.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