From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,e61c8636ef35379d X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-01-18 08:45:47 PST Path: supernews.google.com!sn-xit-02!supernews.com!news.gv.tsc.tdk.com!falcon.america.net!sunqbc.risq.qc.ca!cpk-news-hub1.bbnplanet.com!news.gtei.net!newsfeed.cwix.com!sjc-peer.news.verio.net!news.verio.net!sjc-read.news.verio.net.POSTED!not-for-mail Newsgroups: comp.lang.ada From: Brian Rogoff Subject: Re: Examples in Docs, was Re: Escape Sequences in Strings In-Reply-To: <945oq2$81c$1@nnrp1.deja.com> Message-ID: References: <93objj$guk$1@nnrp1.deja.com> <93q77h$rr6$1@nnrp1.deja.com> <940f9j$nj2$1@nnrp1.deja.com> <940n0u$tnf$1@nnrp1.deja.com> <942brr$b0t$1@nnrp1.deja.com> <942vqr$sd0$1@nnrp1.deja.com> <945oq2$81c$1@nnrp1.deja.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Date: Thu, 18 Jan 2001 16:45:16 GMT NNTP-Posting-Host: 206.184.139.136 X-Complaints-To: abuse@verio.net X-Trace: sjc-read.news.verio.net 979836316 206.184.139.136 (Thu, 18 Jan 2001 16:45:16 GMT) NNTP-Posting-Date: Thu, 18 Jan 2001 16:45:16 GMT Organization: Verio Xref: supernews.google.com comp.lang.ada:4173 Date: 2001-01-18T16:45:16+00:00 List-Id: On Thu, 18 Jan 2001, Robert Dewar wrote: > In article > , > Brian Rogoff 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-, Oberon-, 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 :-)