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, 16 Apr 2020 21:16:44 -0700 (PDT)
Date: 2020-04-16T21:16:44-07:00	[thread overview]
Message-ID: <fb6d2982-777a-467f-bda7-2da44f8af409@googlegroups.com> (raw)
In-Reply-To: <27b11294-d628-4118-8328-a4a9a3946937@googlegroups.com>

On Tuesday, December 3, 2019 at 10:29:15 AM UTC-5, Optikos wrote:
> On Tuesday, December 3, 2019 at 9:04:13 AM UTC-6, Lucretia wrote:
> > On Tuesday, 3 December 2019 14:04:24 UTC, AdaMagica  wrote:
> > > Am Dienstag, 3. Dezember 2019 14:57:53 UTC+1 schrieb Lucretia:
> > > > People coming from other languages might not grasp types easily,
> > > 
> > > Hey, what's difficult to understand in
> > > 
> > > type Temperature is range -40 .. 40;  -- Celsius
> > > 
> > > for a home thermometer?
> > 
> > I don't have a problem, I get it, I'm saying that apparently other people do. But still, there's nothing
> > wrong with just starting with pre-defined types, they're there for a reason. Jesus!
> 
> There is a wise middle ground between the 2 extremes between what you & AdaMagica are saying.
> 
> strict) AdaMagica appears to be saying that rock-solid analysis of finding the upper & lower bounds of the integer's range (or fixed or floating point or BCD for that matter) is of crucial insight & importance to understanding the problem.
> 
> loose) You appear to be saying that for rapid prototyping that that deep analysis can be postponed.
> 
> midling) The middle ground is to use a named type* of a predefined** (not range-restricted subtype of) predefined type that represents the problem domain's meaning.  Then at a (perhaps much) later time restrict the range of that named type only at the single point of declaration in the package specification, which then takes effect at all points of usage of that named type in other declarations and in the package body without modifying all those points of usage to refer to a different name(d type).

That's _literally_ what my book does.  In fact, in the first chapter I explain the advantages of restricting types.  I simply choose to cover the complexities of Ada's types later on so that a new reader does not feel like he/she is lost.

  parent reply	other threads:[~2020-04-17  4:16 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 [this message]
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
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