caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Sergey Goldgaber <sgoldgaber@yahoo.com>
To: William Lovas <wlovas@stwing.upenn.edu>, Caml-list <caml-list@inria.fr>
Subject: Re: [Caml-list] poll - need for a good introductory OCaml book (LONG)
Date: Fri, 14 Mar 2003 04:16:39 -0800 (PST)	[thread overview]
Message-ID: <20030314121639.96651.qmail@web11008.mail.yahoo.com> (raw)
In-Reply-To: <20030314112037.GA1373@force.stwing.upenn.edu>

--- William Lovas <wlovas@stwing.upenn.edu> wrote:
>
> What do you mean by "go to waste"?  If learning language B was the
> key factor in your learning of language A, did language B really go
> to waste?

Of course not.  It's not a complete waste that I once learned BASIC
and Logo.  But I haven't used them in twenty years and am probably
never going to use them again (well, I might use Logo again if I am
to teach programming, but that would really require relearning it
anyway).

> I know you've heard this before, but let me restate it again in this
> context: to really learn O'Caml, you have to learn the core ideas of
> functional programming, and these core ideas are nearly identical in
> all functional programming languages.

Yes.  I recognize that.  But why can't I learn those ideas in OCaml?
Why must I learn yet another language?

> So if you happen to find the perfect beginner's Haskell tutorial out
> there, don't fret -- have a look!  You'll have to learn a bit of new
> syntax here and there, but when you come to understand O'Caml -- and
> i mean *really* understand O'Caml -- it will be more than worth your
> while.

I am open to just such an approach.  In fact, I have been slowly
going through the SICP, which teaches Scheme, and am going to have a
look at Noel Welsh's recommendation as well.  Nonetheless, I know it
will take twice the time and effor to learn two languages than one
(well, maybe 1.5 times the effort), and one of them I'll likely
never use again once it's helped me to learn the one I'm really
after: OCaml (at this point).  So while it won't be a complete
waste, there will be at least some redundancy involved.

> Unfortunately for O'Caml's popularity, people who want to learn
> O'Caml have to, in essence, re-learn programming, because the
> basic concepts of functional programming do not map cleanly onto
> the basic concepts of typical imperative programming.

Yes, I think part of the reason is that functional programming is
"just different" from imperative programming.  However, an
additional reason may be that imperative programming is just
intuitively easier to grasp.  I have yet to hear about or from
people for whom a functional language was their first and they found
learning it as easy as do people who learn an imperative language as
their first language.  That is, unless they are already familiar
with Lambda calculus, which seems to figure greatly in functional
programming.

> Maybe i'm being too idealistic here, but i think a "perfect" tutorial
> for O'Caml should focus on the ways it's different from other
> programming languages, not the ways it's the same.

I think those distinctions are definately crucial to really
understanding OCaml.  In fact, it is precisely in those aspects of
the language which are very different from the imperative style that
I'm used to, that I am having the most trouble.  So a tuturial that
did a great job explaining and teaching those aspects would be
great.

But I'm not sure that those difficult aspects should be the very
first thing that a newbie should encounter.  I think a more fruitful
approach would be to show them first that the language can be useful
in very similar ways to ways they are used to (OCaml's imperative
features).  They will thus more quickly grasp the syntax, become
comfortable with the compiler/toplevel and should be able to slowly,
one at a time start to apply what they learn concerning the more
difficult aspects.

Not that any tutorial jumps right out and tries to teach the newbie
difficult idioms, but they usually leave the imperative aspects
of the language 'till later, which I think is a mistake.

I don't share your, implied, fear that someone might get turned off
if a tutorial starts off by showing only language features which
will be familiar to imperative language programmers.  If they're
learning OCaml then they know the language is different and they
know it has all of these magical features.  Just because they don't
learn the magic right away doesn't mean that they'll abandon the
quest.

In fact, I think they'll be heartened to see that the language is
learnable, in contrast to the reaction they'd likely have to a
trial-by-fire, throw them in the deep-end approach that would show
them the language is different, all right...  But it will be
frustrating, and they'll have a very hard time making sense of it,
and especially applying what they've learned.

> Perhaps such a tutorial (if it doesn't exist already) could be
> prefaced by a number of "O'Caml for the X programmer" hooks,
> for each conventional popular language X, just to
> get programmers well-versed in X excited about O'Caml, at which point
> they can segue into this "perfect" tutorial and learn what functional
> programming is all about. :)

Yes.  In fact, there's already a short "C++/Java programmer's
introduction to Objective Caml".  I don't know either language, so I
can't really comment on that.  But I think the important thing is to
go from imperative to functional style, rather than a particular
language.  I just picked C in my earlier post because it was so
widespread and most everyone will be able to understand if OCaml is
juxtaposed with it.


  --Sergey


__________________________________________________
Do you Yahoo!?
Yahoo! Web Hosting - establish your business online
http://webhosting.yahoo.com

-------------------
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


  parent reply	other threads:[~2003-03-14 12:16 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-03-14  8:12 Sergey Goldgaber
2003-03-14  9:51 ` Noel Welsh
2003-03-14 10:36   ` Sergey Goldgaber
2003-03-14 10:47     ` Noel Welsh
2003-03-14 11:13       ` Sergey Goldgaber
2003-03-14 11:47         ` Noel Welsh
2003-03-14 12:59         ` Geoff Wozniak
2003-03-14 11:20     ` William Lovas
2003-03-14 11:38       ` MikhailFedotov
2003-03-14 12:16       ` Sergey Goldgaber [this message]
2003-03-14 18:57         ` Richard W.M. Jones
2003-03-14 14:17       ` Guido Kollerie
2003-03-14 14:52 ` Fred Yankowski
2003-03-14 17:24 ` Brian Hurt
2003-03-16  0:44 isaac gouy
     [not found] <20030318093223.I30420@latour.inria.fr>
2003-03-18  9:47 ` Sergey Goldgaber

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=20030314121639.96651.qmail@web11008.mail.yahoo.com \
    --to=sgoldgaber@yahoo.com \
    --cc=caml-list@inria.fr \
    --cc=wlovas@stwing.upenn.edu \
    /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;
as well as URLs for NNTP newsgroup(s).