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,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 2002:a05:6214:727:: with SMTP id c7mr928221qvz.81.1587097004895; Thu, 16 Apr 2020 21:16:44 -0700 (PDT) X-Received: by 2002:a9d:6d91:: with SMTP id x17mr1153881otp.340.1587097004607; Thu, 16 Apr 2020 21:16:44 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!feeder.eternal-september.org!news.gegeweb.eu!gegeweb.org!usenet-fr.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Thu, 16 Apr 2020 21:16:44 -0700 (PDT) In-Reply-To: <27b11294-d628-4118-8328-a4a9a3946937@googlegroups.com> Complaints-To: groups-abuse@google.com Injection-Info: google-groups.googlegroups.com; posting-host=2601:18f:982:19b0:2b2:dcfe:2ee3:7563; posting-account=3pYsyQoAAACcI-ym7XtMOI2PDU8gRZS5 NNTP-Posting-Host: 2601:18f:982:19b0:2b2:dcfe:2ee3:7563 References: <87muca3vgd.fsf@nightsong.com> <57d49047-0a61-4d13-8822-d004732a3acc@googlegroups.com> <3b1b248b-43d0-4762-b1f5-1c5460d24c8b@googlegroups.com> <5e222e6c-7afe-4349-ac66-d9b78ca40ec6@googlegroups.com> <27b11294-d628-4118-8328-a4a9a3946937@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: Beginning Ada Programming, by Andrew T. Shvets (2020) From: Andrew Shvets Injection-Date: Fri, 17 Apr 2020 04:16:44 +0000 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Xref: reader01.eternal-september.org comp.lang.ada:58387 Date: 2020-04-16T21:16:44-07:00 List-Id: 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, > > >=20 > > > Hey, what's difficult to understand in > > >=20 > > > type Temperature is range -40 .. 40; -- Celsius > > >=20 > > > for a home thermometer? > >=20 > > I don't have a problem, I get it, I'm saying that apparently other peop= le do. But still, there's nothing > > wrong with just starting with pre-defined types, they're there for a re= ason. Jesus! >=20 > There is a wise middle ground between the 2 extremes between what you & A= daMagica are saying. >=20 > strict) AdaMagica appears to be saying that rock-solid analysis of findin= g the upper & lower bounds of the integer's range (or fixed or floating poi= nt or BCD for that matter) is of crucial insight & importance to understand= ing the problem. >=20 > loose) You appear to be saying that for rapid prototyping that that deep = analysis can be postponed. >=20 > midling) The middle ground is to use a named type* of a predefined** (not= range-restricted subtype of) predefined type that represents the problem d= omain'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 spe= cification, which then takes effect at all points of usage of that named ty= pe in other declarations and in the package body without modifying all thos= e 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 expl= ain the advantages of restricting types. I simply choose to cover the comp= lexities of Ada's types later on so that a new reader does not feel like he= /she is lost.