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: 107f24,626a0a064b320310 X-Google-Attributes: gid107f24,public X-Google-Thread: f4fd2,626a0a064b320310 X-Google-Attributes: gidf4fd2,public X-Google-Thread: 103376,ea8ea502d35ca2ce X-Google-Attributes: gid103376,public X-Google-Thread: 114809,626a0a064b320310 X-Google-Attributes: gid114809,public X-Google-Thread: 10259a,626a0a064b320310 X-Google-Attributes: gid10259a,public X-Google-Thread: 103d24,626a0a064b320310 X-Google-Attributes: gid103d24,public X-Google-Thread: 1164ba,626a0a064b320310 X-Google-Attributes: gid1164ba,public X-Google-ArrivalTime: 2001-05-10 09:44:06 PST Path: newsfeed.google.com!newsfeed.stanford.edu!skynet.be!newsfeed00.sul.t-online.de!t-online.de!newsfeed.r-kom.de!news-nue1.dfn.de!news-lei1.dfn.de!news.uni-leipzig.de!fu-berlin.de!uni-berlin.de!enterprice.st-peter.stw.uni-erlangen.DE!not-for-mail From: Jochen Schmidt Newsgroups: comp.lang.ada,comp.lang.lisp,comp.lang.smalltalk,comp.lang.basic,comp.lang.functional,comp.lang.scheme,comp.lang.perl Subject: Re: Beginner's Language? Followup-To: comp.lang.ada Date: Thu, 10 May 2001 18:49:44 +0200 Organization: Dataheaven Message-ID: <9deggj$httk3$1@ID-22205.news.dfncis.de> References: <9cukad$nn68@news-dxb> <9d6b6e$1bt$1@nh.pace.co.uk> <87snihxiwc.fsf@frown.here> <9dbi83$sji$1@nh.pace.co.uk> <9deb6a$hdp$1@a1-hrz.uni-duisburg.de> NNTP-Posting-Host: enterprice.st-peter.stw.uni-erlangen.de (131.188.24.131) Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7Bit X-Trace: fu-berlin.de 989513043 18806403 131.188.24.131 (16 [22205]) User-Agent: KNode/0.4 Xref: newsfeed.google.com comp.lang.ada:7489 comp.lang.lisp:9959 comp.lang.smalltalk:9696 comp.lang.functional:5631 comp.lang.scheme:3784 comp.lang.perl:2788 Date: 2001-05-10T18:49:44+02:00 List-Id: Georg Bauhaus wrote: > Marin David Condic (marin.condic.auntie.spam@pacemicro.com) wrote: > > : If you are familiar with Lisp, try this: Write a small program to read > : in a couple of numbers from a keyboard, do some math with them and print > : the result to the screen. Now look at it. Could a neophite with > : literally *zero* > > > Then, Ola Rinta-Koski (with f'Up to iso-something): > > "(let ((foo 0)) > (dotimes (i 5) > (incf foo (read))) > foo) > > [is easy]" > > : That's why I wouldn't recommend Lisp as a first programming language in > : an intro to CS course. > > : Gee. I never thought I'd have to defend THAT statement! :-) > > The above looks like Scheme with macros(?) and has a few didactical > problems, as I'd like to report, with some additional guesses thrown in. It seems to be CommonLisp. You could also write: (loop :repeat 5 :sum (read)) Which is maybe easier to understand. > (not to say that these problems are not present in many or all > other languages): You may have to answer some questions from your > inexperieced(!) listeners, > - what is let? and then: why do I have to place an additional pair > of parens around foo 0? > - what is i for? > - what does it mean that this foo is standing on its own > on the last line? > - if the first thing in a list is a function that does something > with the rest, then what function is i? > - ... some of your questions are IMHO biased through your knowledge of languages like Pascal, C... If they are _really_ newbies some of those questions will *never* arise because they have nothing to compare with (like you do here) Taking the example in C #include int main (int argc, char** argv) { int sum=0; int foo=0; int i=0; for (;i<5;++i) { scanf("%d", &foo); sum=sum+foo; } printf("%d", sum); } It is not clear to me that this could be easier to explain then the first Lisp-variant. - What is #include - What is - What is int - What is main - What is argc - What is char** (!!!) - What is argv - what is for - why are ";" used in for instead of "," in other places... - what is scanf - what is this %d thingy - what is the & before foo - what is printf - What are those {,} all around - If functions are recocnized by a opening paren after there name, why are the parameters of the function foo splitted by ";" and why is there no ";" at the end of the line but this "{" thingy.... Pascal is not much easier in this point... BASIC: FOR i = 0 TO 5 INPUT foo sum = sum + foo NEXT i PRINT sum would be rather understandable but is IMHO beaten by far through (loop :repeat 5 :sum (read)) But I've to say that it is absolutely unrealistic to begin with such a function. The first lessons should *not* contain any control-statements. The nice thing with Lisp is that you can begin with simple arithmetic without teaching I/O Functions first. So they can compare the first lessons with using a more and more sophisticated calculator. Regards, Jochen