comp.lang.ada
 help / color / mirror / Atom feed
From: Brian Rogoff <bpr@shell5.ba.best.com>
Subject: Re: Examples in Docs, was Re: Escape Sequences in Strings
Date: Thu, 18 Jan 2001 16:45:16 GMT
Date: 2001-01-18T16:45:16+00:00	[thread overview]
Message-ID: <Pine.BSF.4.21.0101180808230.9927-100000@shell5.ba.best.com> (raw)
In-Reply-To: <945oq2$81c$1@nnrp1.deja.com>

On Thu, 18 Jan 2001, Robert Dewar wrote:
> In article
> <Pine.BSF.4.21.0101170815001.21897-100000@shell5.ba.best.com>,
>   Brian Rogoff <bpr@shell5.ba.best.com> wrote:
> > I wonder if you learned SML programming from "The Definition
> > of Standard ML" :-).
> 
> Yes, it's the only document I ever read to learn ML.

Well, I am in awe. If I remember correctly, there are a few important
aspects of SML programming, like evaluation order, that are not
explicitly stated but have to be deduced. I can't imagine anyone getting a 
feel for how to program in ML from the definition, especially if they were 
not familiar with functional programming style.  

> > Seriously, I'm pretty amazed that anyone can learn to program
> > from a  typical language spec without examples. Do you think
> > it is a learnable  and teachable skill (do you teach your
> > students this?), or is it a unique quirk?
> 
> Well certainly it helps to have a lot of experience in looking
> at different language designs.

When you started your career as a language researcher, did you learn from 
language specs? I realize that this is a bit off topic for the ng, but I 
can always find a way to relate it to Ada :-) if people complain. 

> I don't think it is a quirk by any means. After all a
> mathematician does not need examples of what a proof is
> talking about.

I agree, but I think mathematics is quite a bit different from
programming, and I have a decent background in both. (Note to 
RBKD: that's why I chose SML as an example, since it's definition is 
the most "mathematical" of any well known current programming language).
If we look at the history of certain ideas in mathematics, say the 
foundations of the infinitesimal calculus (*), we see that the progress 
is from examples to rules, not the other way around. I learned counting
from examples before I learned Peano's Axioms. 

Bourbaki /= good pedagogy

> Examples can never tell you what the general rules are, they
> can only illustrate particular cases, and therefore there is
> a danger of not understanding the generalization.

I agree with this. That's why I like to have a reference manual at my side 
when I'm learning. However, I've found that like most people I learn best 
by example. I personally detest the analogy between programming languages 
and human languages, since any good Chomskyan will tell you we have hard
wiring for the latter, but I suspect that even you Robert learned your
native language by generalizing incorrectly from examples.
 
> Certainly a BNF grammar is a FAR clearer documentation of
> syntax than syntactic examples, wouldn't you agree?

Of course! However, when I learn a new programming language, to get an
idea of the syntax I look at a few representative examples first. That
allows me to get an idea if the syntax is familiar. Here is a rough cut at
some language syntax "classes" where I've grouped languages into
*synatactically" similar groups:

Algol: Pascal, Modula-<X>, Oberon-<X>, Ada, Dylan
C : C++, Objective-C, Java, C#
Lisp: Scheme, Emacs-Lisp, Common-Lisp...
Prolog: Erlang, Mercury
Haskell: Clean, Python, OCCAM ("offset rules")
ML: SML, OCaml

While I'm not intimately familiar with all of these languages, a quick
glance at new language examples allows me to categorize it (or not!) and 
I find that I can get up to speed *on syntax* quickly. Then, afterwards, I 
go to the BNF. I take it that you just go straight to the BNF and skip 
the examples altogether.

The reason I asked if you teach your way, and if students are receptive, 
is that I'd be interested in trying it myself. In fact, I'll try this
with the next PL I learn. 

-- Brian

(*) Yes, I deliberately used "infinitesimal". I'm a rebel. The theory of 
    limits is oppressive, and infinitesimals came first. Non-standard 
    analysis rules :-)





  reply	other threads:[~2001-01-18 16:45 UTC|newest]

Thread overview: 94+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-11-15  0:00 Escape Sequences in Strings Jean Cohen
2000-11-15  0:00 ` Marin David Condic
2000-11-16  0:00   ` Ada Streams usage (was Escape Sequences in Strings) Marc A. Criley
2000-11-16  0:00     ` Marin David Condic
2000-11-16  0:00       ` Ted Dennison
2000-11-16  0:00         ` Marin David Condic
2000-11-16  0:00           ` Ted Dennison
2000-11-16  0:00             ` Marin David Condic
     [not found]     ` <igh81t8b3hdrsc167do6qr0h1joa73c1jr@borpin.co.uk>
2000-11-18  0:00       ` Marin David Condic
2000-11-18  0:00         ` David Kristola
2000-11-19  0:00           ` Marin David Condic
2000-11-19  0:00             ` Marin David Condic
2000-11-20  0:00               ` Brian Orpin
2000-11-20  0:00                 ` Marin David Condic
2000-11-19  0:00         ` Ted Dennison
2000-11-19  0:00           ` Marin David Condic
2000-11-19  0:00             ` Robert Dewar
2000-11-20  0:00               ` Randy Brukardt
2000-11-21  0:00                 ` Ted Dennison
2000-11-21  0:00                   ` Randy Brukardt
2000-11-21  1:31                 ` Robert Dewar
2000-11-21  1:33                 ` Robert Dewar
2000-11-21  0:00                   ` Randy Brukardt
2000-11-22  5:00                     ` Robert Dewar
2000-11-20  0:00               ` Marin David Condic
2000-11-21  0:00                 ` Robert Dewar
2000-11-19  0:00             ` Ted Dennison
2000-11-19  0:00               ` Robert Dewar
2000-11-15  0:00 ` Escape Sequences in Strings Preben Randhol
2000-11-15  0:00 ` John English
2000-11-15  0:00   ` Robert Dewar
2000-11-15  0:00     ` Ehud Lamm
2000-11-16  0:00       ` John English
2000-11-16  0:00         ` Tarjei T. Jensen
2000-11-16  0:00           ` Ken Garlington
2000-11-16  0:00             ` Keith Thompson
2000-11-16  0:00             ` Marin David Condic
2000-11-16  0:00         ` Marin David Condic
2001-01-12 13:18 ` Andrew Hately
2001-01-12 20:03   ` Keith Thompson
2001-01-18  8:29     ` Lao Xiao Hai
2001-01-18 15:22       ` Robert Dewar
2001-01-18 22:43         ` Randy Brukardt
2001-01-21 11:54         ` Dale Stanbrough
2001-01-21 22:35           ` directly accessing DOS screen memory (was: Re: Escape Sequences in Strings) Jeffrey Carter
2001-01-12 19:37 ` Escape Sequences in Strings tmoran
2001-01-13  1:38   ` Robert Dewar
2001-01-13  6:48     ` tmoran
2001-01-13 18:36       ` Robert Dewar
2001-01-16  3:30         ` Examples in Docs, was " peter_richtmyer
2001-01-16  5:42           ` Robert Dewar
2001-01-16 20:44             ` mark_lundquist
2001-01-16 22:43               ` Larry Kilgallen
2001-01-17 15:06                 ` mark_lundquist
2001-01-17  2:25               ` Robert Dewar
2001-01-17 15:28                 ` mark_lundquist
2001-01-17 16:20                 ` Brian Rogoff
2001-01-17 18:04                   ` Wayne Lydecker
2001-01-17 19:23                     ` BSCrawford
2001-01-18  0:15                       ` Jerry Petrey
2001-01-19  0:01                     ` tmoran
2001-01-18  3:44                   ` Robert Dewar
2001-01-18 16:45                     ` Brian Rogoff [this message]
2001-01-18 19:53                       ` Robert Dewar
2001-01-18 22:58                         ` Georg Bauhaus
2001-01-19 16:40                           ` Robert Dewar
2001-01-19  7:49                         ` Learning methods Anders Wirzenius
2001-01-19 18:57                         ` Examples in Docs, was Re: Escape Sequences in Strings mark_lundquist
2001-01-21 12:05                         ` Dale Stanbrough
2001-01-21 15:35                           ` Robert Dewar
2001-01-17 22:10                 ` Matthew Woodcraft
2001-01-18  3:52                   ` Robert Dewar
2001-01-16 16:06           ` Examples in Docs Robert C. Leif, Ph.D.
2001-01-16 21:29             ` mark_lundquist
2001-01-18  0:50               ` Randy Brukardt
2001-01-18 16:46                 ` mark_lundquist
2001-01-18 17:24               ` J. David Bryan
2001-01-17  2:43             ` Robert Dewar
2001-01-17 21:17               ` Robert C. Leif, Ph.D.
2001-01-16 20:01           ` Examples in Docs, was Re: Escape Sequences in Strings mark_lundquist
2001-01-17 10:59             ` Peter Richtmyer
2001-01-19 18:55               ` mark_lundquist
2001-01-20 14:24                 ` Robert Dewar
2001-01-20 14:36                   ` Preben Randhol
2001-01-20 15:00                     ` Robert Dewar
2001-01-21 11:24                       ` Preben Randhol
2001-01-22 14:47                         ` Ted Dennison
2001-01-22 20:08                           ` Preben Randhol
2001-01-22 20:14                             ` Preben Randhol
2001-01-20 19:02                   ` Stephen Leake
2001-01-20 19:50                     ` Georg Bauhaus
2001-01-21 11:35                     ` Preben Randhol
2001-01-22 23:58                   ` Mark Lundquist
2001-01-27  1:43                   ` Increasing the readability of Ada was RE: Examples in Docs Robert C. Leif, Ph.D.
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox