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: f4fd2,626a0a064b320310 X-Google-Attributes: gidf4fd2,public X-Google-Thread: 103376,ea8ea502d35ca2ce X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-05-10 10:22:52 PST Message-ID: <3AFACCA0.303A79AF@baesystems.com> Date: Thu, 10 May 2001 18:15:12 +0100 From: David Gillon Organization: BAE SYSTEMS Avionics (Rochester) X-Mailer: Mozilla 4.5 [en] (WinNT; I) X-Accept-Language: en MIME-Version: 1.0 Newsgroups: comp.lang.ada,comp.lang.lisp Subject: Re: Beginner's Language? References: <9cukad$nn68@news-dxb> <9d6b6e$1bt$1@nh.pace.co.uk> <87snihxiwc.fsf@frown.here> <9dbi83$sji$1@nh.pace.co.uk> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit NNTP-Posting-Host: rc3284.rochstr.gmav.gecm.com X-Trace: 10 May 2001 18:07:15 GMT, rc3284.rochstr.gmav.gecm.com Path: newsfeed.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!dispose.news.demon.net!demon!btnet-peer0!btnet-feed5!btnet!newreader.ukcore.bt.net!pull.gecm.com!rc3284.rochstr.gmav.gecm.com Xref: newsfeed.google.com comp.lang.ada:7490 comp.lang.lisp:9969 Date: 2001-05-10T18:15:12+01:00 List-Id: Ola Rinta-Koski wrote: > > (let ((foo 0)) > (dotimes (i 5) > (incf foo (read))) > foo) > > > Now look at it. Could a neophite with literally *zero* > > experience in programming computers read it and stand a chance of > > understanding what it does or how it does it? > > Not being a neophyte, I'll just have to guess: yes and yes. Well, I'll admit that despite a CS degree (including a course specifically aimed at comparing different languages) and fifteen years in the industry I can't claim to know what this code does, so any complete neophyte is going to be floundering. I can guess we have a loop doing something to Foo, but beyond that ...? Sum five (could also be 6) inputs seems most likely, but that's based on my knowledge of parallel constructs in other languages and therefore more than a true neophyte could get. Despite all the criticisms that can legitimately be levelled at BASIC I originally taught myself to code from BASIC examples in computer magazines, I don't believe that would have been true if they had looked like the example above instead of paralleling natural language. And what BASIC does better than this Pascal and Ada do better still. There's also a strong cultural element to be considered beyond the strict grammar of the language. A language that stays close to natural language (at least for the anglophone part of the population), which encourages meaningful variable names and cleanly structured, readable, well commented code is going to be far easier for someone with limited knowledge to understand (or maintain). A CS/SE course that teaches good coding practise rather than just coding is going to produce people who'll be both more useful to their employers and gain the course a good reputation I much prefer the following to the example above and I believe that even with all comments stripped out it would be inherently easier to understand for a struggling student: procedure Sum_Five_Values is -- Description : -- Example showing clear coding practice, sums five integer inputs -- and displays result -- Input Parameters : -- None (uses keyboard) -- Output Parameters : -- None (uses screen) -- Modification History : -- 10-05-2001, Initial version, DWG -- ,, Total_Count : Integer := 0; Entered_Value : Integer; begin -- Sum five inputs from the keyboard for Loop_Counter := 1 .. 5 do begin Put_Line ("Enter an integer value and press return"); Get (Entered_Value); Total_Count := Total_Count + Entered_Value; end; -- report the final result to the screen Put("Total Value = "); Put_Line(Total_Count); end Sum_Five_Values; -- David Gillon