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=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail From: "J-P. Rosen" Newsgroups: comp.lang.ada Subject: Teaching Ada types Date: Fri, 17 Apr 2020 08:17:44 +0200 Organization: Adalog Message-ID: 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> <80bcdfd1-b1e5-4ebf-aa8a-4beaba5ec3c2@googlegroups.com> <60e61003-409d-4bd5-9784-8ddad5942934@googlegroups.com> <4faaddd0-cc31-43e5-bd9e-fa0dded08778@googlegroups.com> <41d010aa-7408-49d7-bc0a-7c346222f862@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Injection-Date: Fri, 17 Apr 2020 06:17:44 -0000 (UTC) Injection-Info: reader02.eternal-september.org; posting-host="d6a0954363742def855d74f2f7547638"; logging-data="31832"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19s0a0FHXauXuJxvPNctXe+" User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 Cancel-Lock: sha1:8YWgzvgOAmXdKIB+urPUIfXjVwQ= In-Reply-To: <41d010aa-7408-49d7-bc0a-7c346222f862@googlegroups.com> Content-Language: fr Xref: reader01.eternal-september.org comp.lang.ada:58392 Date: 2020-04-17T08:17:44+02:00 List-Id: (was: Re: Beginning Ada Programming, by Andrew T. Shvets (2020)) Here is how I explain the Ada approach: Whatever the language, when you need to represent data, it is important to choose an appropriate type. This involves two steps: 1) Analyze your problem to determine the requirements (range f.e.) on your type 2) Make a representation choice, i.e. choose a machine type that covers the requirements of 1) Ada saves you step 2), by allowing you to express your needs directly, and leaving the choice of representation to the compiler. The trouble is that other languages offer only machine types (for basic types). Therefore, most people tend to think directly in terms of machine types and skip step 1. -------------------------------------------------------- Of course, this assumes that you teach how to create software, and not just a language. Some times ago, a little niece of mine started a software school. I was especially interested in how design was taught! Well, the school taught the syntax of C, and then gave programming exercises. I asked: "but how did they teach you how to go from a problem statement to its solution?" She didn't even understand what I was talking about. Sigh... -- 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