comp.lang.ada
 help / color / mirror / Atom feed
From: Friedrich Dominicus <frido@q-software-solutions.com>
Subject: Re: Beginner's Language?
Date: 11 May 2001 07:29:10 +0200
Date: 2001-05-11T07:29:10+02:00	[thread overview]
Message-ID: <87oft0pi6x.fsf@frown.here> (raw)
In-Reply-To: 3AFACCA0.303A79AF@baesystems.com

David Gillon <david.gillon@baesystems.com> writes:

> 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
>   --   <DD-MM-YYYY>,<Description of change>,<Author>
> 
>   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;
(defun sum-n-numbers (n)
  "Read n numbers from the standard input and add them all"
  (let ((element 0)
        (total-sum 0))
    (loop for i from 1 to n
          do
          (format t "Give me a number please : ")
          (setf element (read))
          (setf total-sum (+ total-sum element))
          
          finally
          (format t "Total Sum = ~A~%" total-sum))))


Now I don't think I ever would write it that way, but hey it's as
verbose as you want it to be ;-)

Now alternatively one could write:
(defun sum-n-numbers (n)
  (loop for i from 1 to n
        for prompt = (format t "Give me a number please ")
        for element = (read)
        sum element into total-sum

        finally (format t "Total Sum = ~A~%" total-sum)))


     
or
(defun sum-n-numbers (n)
  (let ((total-sum 0))
    (dotimes (i n)
      (format t "Give me a number please: ")
      (let ((element (read)))
        (incf total-sum element)))
    (format t "Total Sum = ~A~%" total-sum)
     (values)))

or
....

I doubt that the Basic solution is easier on the eyes for a beginner
than one of the Common Lisp solutions.

Anyway programming I would conclude that learning programming is
work it can be even very hard. As usual if you start with something
completly new you're lost in the details. You do not know what really
is important all looks more or less like black magic. So what a
beginner needs is either a very good book or a good teacher and he/she
must really want to learn programming.

What we never should forget is that having fun while learning is a
maybe not the worst thing. If you can get nice results fast, it's very
encouraging.

One can compare programming with a lot of other things. It's like a
game, a puzzle or like building a model.


Every game has it's rules a puzzle can be build just in one way and
you have to follow a order to get a model build. All this holds for
programming the rules are what the language asks you for, getting the
pieces together will gave the whole picture. If you miss one piece
well, your programm like you puzzle will be incomplete. The model is
the idea you have while working on you program.

I really can't tell what a beginer is looking for, those times are
still gone for me and for you. That means if we show "what we think"
is understandable or "readable" for a beginner, it's nearly completly
irrelevant to them. They have their own idea, there will some which
like C, Assembler, Pascal, Modula-2, C++, Java, Lisp, Haskell or
whatever and find some other things totally stupid.

So I suggest not to put one of the languages down, but assist anyone
who wants to learn programming in whatever you like. Let him/her make
the choice and fine...

Regards
Friedrich



  parent reply	other threads:[~2001-05-11  5:29 UTC|newest]

Thread overview: 232+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-05-04 16:12 Beginner's Language? Faisal Halim
2001-05-04 16:29 ` Marin David Condic
2001-05-04 17:14 ` chris.danx
2001-05-04 22:35 ` Jeffrey Carter
2001-05-05  1:51 ` raj
2001-05-05 14:51   ` Carl E Gundel
2001-05-05 18:12   ` Dodger
2001-05-05 19:06     ` Jochen Schmidt
2001-05-05 22:59       ` Randal L. Schwartz
2001-05-05 23:38         ` Jochen Schmidt
2001-05-08 16:01           ` John English
2001-05-08 18:37             ` Brian Rogoff
2001-05-09 11:31               ` John English
2001-05-09 14:33                 ` Ehud Lamm
2001-05-09 16:40             ` Charles Hixson
2001-05-06  2:19         ` Jeffrey Carter
2001-05-18 23:02       ` glauber
2001-05-05 20:09     ` Jeffrey Carter
2001-05-06  1:50     ` raj
2001-05-06  2:09       ` raj
2001-05-06  2:09       ` raj
2001-05-06 15:49         ` Randal L. Schwartz
2001-05-06 22:37           ` Multiparadigm Languages : (was Beginners Language) raj
2001-05-06 22:50           ` Beginner's Language? raj
2001-05-06 23:13           ` Multiparadigm Languages : (was Beginners Language) raj
2001-05-05 19:49   ` Beginner's Language? Larry Kilgallen
2001-05-05 22:52     ` Reinout Heeck
2001-05-06  0:03       ` Dale Stanbrough
2001-05-06  1:47         ` Reinout Heeck
2001-05-06  3:38           ` Dale Stanbrough
2001-05-06  4:05             ` Reinout Heeck
2001-05-06 10:49               ` SV: " Dan Andersson
2001-05-06 11:42                 ` Reinout Heeck
2001-05-06 13:31                   ` SV: " Dan Andersson
2001-05-06 20:17             ` Dave Harris
2001-05-07 10:41     ` Biep @ http://www.biep.org
2001-05-07 10:57       ` Andrew Cooke
2001-05-09 10:22         ` Biep @ http://www.biep.org/
2001-05-10  5:45           ` Raffael Cavallaro
2001-05-10  9:02           ` Jochen Schmidt
2001-05-07 14:24   ` Marin David Condic
2001-05-07 15:45     ` Friedrich Dominicus
2001-05-09  7:19       ` Espen Vestre
2001-05-09 13:55       ` Marin David Condic
2001-05-09 14:18         ` Ola Rinta-Koski
2001-05-09 15:53           ` Marin David Condic
2001-05-10 17:15           ` David Gillon
2001-05-10 19:50             ` Warren W. Gay VE3WWG
2001-05-10 20:15             ` Marie-No�lle Baechler
2001-05-11  5:29             ` Friedrich Dominicus [this message]
2001-05-27 12:59               ` Alejandro R. Mosteo
2001-05-27 22:34                 ` Larry Elmore
2001-06-03 21:18                   ` Stefan Skoglund
2001-05-09 14:53         ` Biep @ http://www.biep.org/
2001-05-09 15:39         ` Friedrich Dominicus
2001-05-09 18:24           ` Andreas Krennmair
2001-05-09 23:01             ` Sashank Varma
2001-05-10  0:01               ` David Starner
2001-05-10  6:10                 ` Mark VandeWettering
2001-05-10  8:08                 ` FM
2001-05-10 15:07                 ` Eugene Zaikonnikov
2001-05-10 20:08                 ` David Thornley
2001-05-16 18:00                 ` Robert Posey
2001-05-16 18:19                   ` stephan
2001-05-21  4:15                     ` Lao Xiao Hai
2001-05-21 11:53                       ` raj
2001-05-23 10:33                         ` Liam Devlin
2001-05-21 21:30                       ` Marie-No�lle Baechler
2001-05-27 12:59                     ` Alejandro R. Mosteo
2001-05-30 20:26                     ` Florian Weimer
2001-05-30 21:56                       ` Johan Kullstam
2001-05-31  9:01                         ` Jean-Pierre Rosen
2001-05-31 13:29                           ` Raymond Toy
2001-05-31 13:51                             ` Jean-Pierre Rosen
2001-05-16 20:44                   ` brlewis
2001-05-21  5:09                   ` vsync
2001-05-10  6:06             ` Mark VandeWettering
2001-05-10  7:57               ` Andrew Bromage
2001-05-10  8:55                 ` Iain McNaughton
2001-05-15  2:02                   ` Rob Warnock
2001-05-15 11:56                     ` Andreas Krennmair
2001-05-15 17:14                       ` FM
2001-05-15 18:08                         ` Andreas Krennmair
2001-05-15 20:37                           ` FM
2001-05-16 17:56                             ` Andreas Krennmair
2001-05-17  3:06                               ` FM
     [not found]                 ` <3AFA5A92.5D4F191C@info.unicaen.fr>
     [not found]                   ` <3AFAD076.C5F31B44@research.bell-labs.com>
     [not found]                     ` <m37kz1utg9.fsf@chaos.resnet.gatech.edu>
2001-06-05 13:03                       ` Biep @ http://www.biep.org/
2001-05-10 13:03               ` John English
2001-05-10 13:44                 ` Michael Livshin
2001-05-16 17:59                   ` Lex Spoon
2001-05-22 14:16                     ` John English
2001-05-22 16:40                       ` Poetry in source code (was: Beginner's Language?) Ted Dennison
2001-05-23 15:24                         ` John English
2001-05-23 17:34                           ` Preben Randhol
2001-05-22 23:31                       ` Beginner's Language? raj
2001-05-23  0:44                       ` Chad R. Meiners
2001-05-28  0:17                       ` Lao Xiao Hai
2001-05-28 19:39                         ` poetry in PL's? (was: Beginner's Language?) Lex Spoon
2001-05-29 13:44                           ` Ted Dennison
2001-05-30 20:34                         ` Beginner's Language? Florian Weimer
2001-05-10  7:28             ` FM
2001-05-10  8:51               ` Jochen Schmidt
2001-05-10 21:32                 ` FM
2001-05-11  0:26                   ` James Rogers
2001-05-12  2:56                 ` FM
2001-05-12 17:06                 ` FM
2001-05-11 15:55               ` Andreas Krennmair
2001-05-11 23:50                 ` [OT] Software Engineering at 14 (was: Re: Beginner's Language?) FM
2001-05-12 11:59                   ` raj
2001-05-12 14:17                     ` Andrew Cooke
2001-05-12 17:09                       ` FM
2001-05-12 14:40                     ` Andreas Krennmair
2001-05-13  1:44                       ` raj
2001-05-13  8:28                         ` [OT] Software Engineering at 14 Markus Mottl
2001-05-13 10:41                           ` Mark Wotton
2001-05-13 12:04                             ` Markus Mottl
2001-05-13 12:48                               ` Mark Wotton
2001-05-13 13:05                                 ` Daniel C. Wang
2001-05-13 22:09                           ` FM
2001-05-13 23:44                             ` Markus Mottl
2001-05-12 19:23                     ` [OT] Software Engineering at 14 (was: Re: Beginner's Language?) Marco Antoniotti
2001-05-12 22:38                     ` [OT] Software Engineering at 14 Markus Mottl
2001-05-13  2:48                     ` [OT] Software Engineering at 14 (was: Re: Beginner's Language?) Jorn W Janneck
2001-05-13  3:00                       ` raj
2001-05-13  8:59                         ` [OT] Software Engineering at 14 Markus Mottl
2001-05-13 11:38                           ` Karel Thönissen
2001-05-13 12:46                             ` Markus Mottl
2001-05-13 14:29                               ` Karel Thönissen
2001-05-13  9:44                         ` [OT] Software Engineering at 14 (was: Re: Beginner's Language?) Andrew Bromage
2001-05-14  7:21                         ` Jorn W Janneck
2001-05-15 22:53                     ` [OT] Software Engineering at 14 Reini Urban
2001-05-15 23:24                       ` FM
2001-05-12 14:33                   ` [OT] Software Engineering at 14 (was: Re: Beginner's Language?) Andreas Krennmair
2001-05-12 20:37                     ` FM
2001-05-12 21:56                       ` Andreas Krennmair
2001-05-12 23:50                         ` FM
2001-05-13  8:02                           ` Andreas Krennmair
2001-05-13 20:55                             ` FM
2001-05-14  9:27                       ` Biep @ http://www.biep.org/
2001-05-13  8:29                     ` thi
2001-05-12 17:20                   ` [OT] Software Engineering at 14 Markus Mottl
2001-05-13 20:15                   ` [OT] Software Engineering at 14 (was: Re: Beginner's Language?) Peter Schuller
2001-05-13 21:54                     ` FM
2001-05-14  4:42                       ` Peter Schuller
2001-05-14  6:21                         ` FM
2001-05-14 18:37                           ` Peter Schuller
2001-05-14 21:18                             ` FM
2001-05-14 22:45                               ` Peter Schuller
2001-05-15  7:49                             ` David Rush
2001-05-15 19:29                               ` Peter Schuller
2001-05-17 15:21                                 ` David Rush
2001-05-17 23:19                                   ` Peter Schuller
2001-05-18  9:50                                     ` Biep @ http://www.biep.org/
2001-05-14  6:30                         ` Peter Schuller
2001-05-14 12:21                         ` James A. Robertson
2001-05-14 10:15                     ` Biep @ http://www.biep.org/
2001-05-15  9:19                 ` Beginner's Language? Siegfried Gonzi
2001-05-15  9:47                   ` Preben Randhol
2001-05-15 12:06                   ` Andreas Krennmair
2001-05-10  8:11             ` Friedrich Dominicus
2001-05-10 11:09             ` Markus Mottl
2001-05-10 14:44             ` Eugene Zaikonnikov
2001-05-10 15:34             ` ssthapa
2001-05-14 19:58             ` Johan Kullstam
2001-05-14 20:14               ` Matthias Blume
2001-05-16 16:16                 ` J�rgen Exner
2001-05-16 20:49                   ` Matthias Blume
2001-05-17  0:22                     ` Boris Smilga
2001-05-17  1:29                     ` a
2001-05-17  3:07                       ` FM
2001-05-17 13:56                       ` Matthias Blume
2001-05-17 17:54                         ` J�rgen Exner
2001-05-09 22:56         ` David Thornley
2001-05-10  9:16           ` Ola Rinta-Koski
2001-05-10 20:17             ` David Thornley
2001-05-10  5:53         ` Mark VandeWettering
2001-05-10  9:22         ` Francis Leboutte
2001-05-10 15:13         ` Georg Bauhaus
2001-05-10 16:49           ` Jochen Schmidt
2001-05-10 17:04             ` Friedrich Dominicus
2001-05-11  7:34           ` Ola Rinta-Koski
2001-05-11 14:47             ` Georg Bauhaus
2001-05-10 15:17         ` brlewis
2001-05-08  0:15     ` Dodger
2001-05-16 16:55       ` Lex Spoon
2001-05-16 17:42         ` Markus Kliegl
2001-05-19 14:24           ` Lex Spoon
2001-05-08  7:11     ` Tarjei T. Jensen
2001-05-08  7:23       ` ronald schroder
2001-05-16 17:53         ` Lex Spoon
2001-05-17  0:54           ` Tim May
2001-05-17  1:15             ` Gary Scott
2001-05-17  7:20               ` Tom Lake
2001-05-19 14:40                 ` Lex Spoon
2001-05-17  8:20           ` Biep @ http://www.biep.org/
2001-05-17 12:43             ` illya
2001-05-08 13:38       ` Marin David Condic
2001-05-08 23:46         ` Beginner's Ide raj
2001-05-09 14:00           ` Marin David Condic
2001-05-09 14:36             ` chris.danx
2001-05-09 19:09               ` Charles Hixson
2001-05-09 19:06           ` Charles Hixson
2001-05-10  6:20             ` Pascal Obry
2001-05-10 15:31               ` Charles Hixson
2001-05-10 16:12                 ` James Rogers
2001-05-10 16:01             ` Stephen Leake
2001-05-11  1:54               ` Retraction : ( Was: Beginner's Ide) raj
2001-05-11 11:44               ` Beginner's Ide Georg Bauhaus
2001-05-11 21:30                 ` Stephen Leake
2001-05-12 17:15                   ` Simon Wright
2001-05-09  5:32     ` Beginner's Language? Simon Wright
2001-05-10 21:50       ` Gary Scott
2001-05-11  2:14       ` raj
2001-05-10  8:02   ` OZ as a beginners' banguage? Biep @ http://www.biep.org/
2001-05-10  8:06     ` Andrew Cooke
2001-05-11 11:13     ` Torbjörn Lager
2001-05-05  6:23 ` Beginner's Language? Gerhard Häring
2001-05-05  9:06   ` David Starner
2001-05-05 11:05     ` chris.danx
2001-05-05 22:12       ` Nacho Robledo
2001-05-06 13:14     ` Florian Weimer
2001-05-06 19:15       ` David Starner
2001-05-06 15:17 ` DuckE
2001-05-06 20:58 ` Frank
2001-05-06 21:12 ` Kenneth Almquist
  -- strict thread matches above, loose matches on Subject: below --
2001-05-10  4:35 yamir
2001-05-31  0:41 robin
2001-05-31  4:15 ` Frank A. Adrian
2001-05-31 15:34   ` Wes Groleau
2001-05-31 19:22     ` David Thornley
2001-06-02 13:37   ` Johan Kullstam
2001-06-02 15:46     ` Frank A. Adrian
replies disabled

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