comp.lang.ada
 help / color / mirror / Atom feed
From: Andrew Shvets <andrew.shvets@gmail.com>
Subject: Re: Beginning Ada Programming, by Andrew T. Shvets (2020)
Date: Thu, 23 Apr 2020 11:45:34 -0700 (PDT)
Date: 2020-04-23T11:45:34-07:00	[thread overview]
Message-ID: <0800ad94-3e49-47dc-9f32-43b0bf6d99c4@googlegroups.com> (raw)
In-Reply-To: <41ef6a77-3b14-43ff-b6ae-510000a33ad4@googlegroups.com>

On Friday, April 17, 2020 at 3:28:29 PM UTC-4, Optikos wrote:
> On Friday, April 17, 2020 at 12:59:11 PM UTC-5, AdaMagica wrote:
> > Am Freitag, 17. April 2020 06:07:15 UTC+2 schrieb Andrew Shvets:
> > > On Tuesday, December 3, 2019 at 8:21:25 AM UTC-5, J-P. Rosen wrote:
> > > > Le 03/12/2019 à 13:33, Lucretia a écrit :
> > > > >> Yes, he is. I had a little conversation on the very first edition
> > > > >> with him. I esp. objected that he started his examples with using
> > > > >> Integer rather than user-defined types (which IMHO is the very
> > > > >> heart of Ada). I do not know whether he changed this.
> > > > 
> > > > > There's nothing wrong with using integer to start off and then moving
> > > > > onto defined types.
> > > > Yes there is! (see my paper at the last Ada-Europe). The first message
> > > > when you teach Ada is that it is all about defining proper types. You
> > > > have to start by fighting bad habits from other languages.
> > > > 
> > > > -- 
> > > > J-P. Rosen
> > > > Adalog
> > > > 2 rue du Docteur Lombard, 92441 Issy-les-Moulineaux CEDEX
> > > > Tel: +33 1 45 29 21 52, Fax: +33 1 45 29 25 00
> > > > http://www.adalog.fr
> > > 
> > > *shrug* You have your own way of looking at this.  However, I really did not want to leave someone that is just starting with a long and academic chapter on types in Ada.  It would be boring and discourage someone from learning Ada.
> > 
> > Why must this be boring?
> > 
> > Define a temperature scale for a home thermometer. It has a measurement range from -30 to +40 °C.
> > 
> > Define a type for values you can read from a foldable meter rod (0 to 2 m).
> 
> What is especially not boring would be to show how the range restriction (on, say, an index into a buffer) precluded writing a worm's machine code off the end as the preclusion of a security vuln commonplace in C.  Now that would be an eye opener for most people coming from other languages.
> 
> What would be especially not boring for the thermometer range restriction (on, say, an automobile that is a competitor of Toyota) precluded a sensor misreading that its absence precluded the gas pedal not getting confused for the brake pedal as an off-by-one in the periodic polling responses in the drive-by-wire CAN network (or whatever minor mistake on the CAN caused those crashes).
> 
> What would be especially not boring would be to show how the range restriction on the low end being 1 or 2 or 3 angle-of-attack sensors could cause different child packages to be swapped in on a Boeing 737 MAX for each of 3 levels of MCAS system integrity with 3 or more AoA sensors begetting a majority-rules voting among the sensors, 2 begetting a usage of the most-sane sensor, and 1 begetting a turn off of the MCAS (or some such pilot-centric way of not having the software crash the airplane).
> 
> Range restrictions for the sake of range restrictions are in fact boring bordering on bicycle shedding for the reader.  The security that they facilitate would definitely enliven the topic.

All of that is covered in the first chapter.  If you go on Amazon and read the first chapter in the preview mode of the book, I talk about this 

The only difference to me is how this topic should be taught.  I prefer to wait after introducing the basic types.  Ada has an amazing type system and it can do great things.  But it’s a complex topic and I want to introduce it in a different way than is usually found in most books.

  parent reply	other threads:[~2020-04-23 18:45 UTC|newest]

Thread overview: 82+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-03  4:05 Beginning Ada Programming, by Andrew T. Shvets (2020) Paul Rubin
2019-12-03 12:11 ` AdaMagica
2019-12-03 12:33   ` Lucretia
2019-12-03 13:21     ` J-P. Rosen
2019-12-03 13:57       ` Lucretia
2019-12-03 14:04         ` AdaMagica
2019-12-03 14:15           ` AdaMagica
2019-12-03 14:39             ` Simon Wright
2019-12-03 14:45               ` Shark8
2019-12-03 17:38               ` J-P. Rosen
2019-12-03 15:04           ` Lucretia
2019-12-03 15:29             ` Optikos
2019-12-03 16:06               ` Lucretia
2019-12-03 16:26                 ` Optikos
2019-12-03 16:50                   ` Lucretia
2019-12-03 17:02                     ` Shark8
2019-12-03 17:29                       ` AdaMagica
2019-12-05 16:35                       ` Dirk Heinrichs
2019-12-05 17:12                         ` AdaMagica
2019-12-09 19:08                           ` Dirk Heinrichs
2019-12-06 18:34                         ` Shark8
2019-12-06 20:29                           ` Jeffrey R. Carter
2019-12-06 21:05                             ` Shark8
2019-12-07  0:47                               ` Randy Brukardt
2019-12-14  4:21                           ` Keith Thompson
2019-12-14 11:34                             ` AdaMagica
2019-12-03 17:39                     ` Optikos
2019-12-03 19:12                       ` Paul Rubin
2019-12-14  4:34                       ` Paul Rubin
2020-04-17  5:14                       ` Andrew Shvets
2020-04-17  6:17                         ` Teaching Ada types J-P. Rosen
2020-04-29 13:07                           ` Mehdi Saada
2020-04-29 21:25                             ` Paul Rubin
2020-04-17  4:27                   ` Beginning Ada Programming, by Andrew T. Shvets (2020) Andrew Shvets
2020-04-17 12:44                     ` Ludovic Brenta
2020-04-17 13:07                       ` Jere
2020-04-17 14:31                       ` Optikos
2019-12-03 20:40               ` Björn Lundin
2020-04-17  4:16               ` Andrew Shvets
2020-04-17  4:11             ` Andrew Shvets
2020-04-17 15:32               ` Luke A. Guest
2020-04-17  4:10           ` Andrew Shvets
2020-04-17  5:02             ` Andrew Shvets
2020-04-17  4:08         ` Andrew Shvets
2019-12-03 19:14       ` Paul Rubin
2019-12-04  6:47         ` J-P. Rosen
2019-12-04  6:49         ` J-P. Rosen
2019-12-04  9:46           ` Paul Rubin
2020-04-17  4:07       ` Andrew Shvets
2020-04-17  5:49         ` J-P. Rosen
2020-04-17 17:59         ` AdaMagica
2020-04-17 19:28           ` Optikos
2020-04-18 15:29             ` AdaMagica
2020-04-18 16:34               ` cantanima.perry
2020-04-18 17:59                 ` Jere
2020-04-18 21:54                   ` cantanima.perry
2020-04-18 22:18                     ` Luke A. Guest
2020-04-18 22:33                       ` Jere
2020-04-19  0:52                         ` Jere
2020-04-19  2:23                       ` Keith Thompson
2020-04-18 22:37                     ` Jere
2020-04-19  0:42                     ` Paul Rubin
2020-05-02 19:13                 ` dave_thompson_2
2020-04-23 18:43             ` Andrew Shvets
2020-04-23 21:07               ` Paul Rubin
2020-04-23 21:33                 ` Optikos
2020-04-23 21:42                   ` Paul Rubin
2020-04-24 14:42                     ` Optikos
2020-04-24 15:35                       ` Dennis Lee Bieber
2020-04-30  8:01                       ` Paul Rubin
2020-04-23 18:45             ` Andrew Shvets [this message]
2020-11-02 21:14       ` Norman Worth
2020-04-17  4:04   ` Andrew Shvets
2019-12-10  5:17 ` Jerry
2020-04-17  3:58 ` Andrew Shvets
2020-05-09 12:39   ` Chris Collings
2020-10-03  4:23     ` andrew...@gmail.com
2020-10-28 19:21       ` sany...@gmail.com
2020-11-11  1:41 ` Azathoth Hastur
2020-11-12 21:24   ` Shark8
2020-11-12 22:31     ` Chris Townley
2020-11-17 20:48     ` azathot...@gmail.com
replies disabled

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