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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!news.unit0.net!cyclone03.ams2.highwinds-media.com!news.highwinds-media.com!voer-me.highwinds-media.com!peer03.am1!peering.am1!npeersf04.am4!fx04.fr7.POSTED!not-for-mail Message-ID: From: Mike H Reply-To: Mike Hopkins Newsgroups: comp.lang.ada Subject: Re: 4 beginner's questions on the PL Ada References: <87ob96ajv6.fsf@VLAN-3434.student.uu.se> <877gfucton.fsf@VLAN-3434.student.uu.se> <87pptmb4p9.fsf@VLAN-3434.student.uu.se> <88cb99c6-df8b-49f8-ac53-54b737a02c34@googlegroups.com> <87eha1787k.fsf@VLAN-3434.student.uu.se> <877gfss8k4.fsf@VLAN-3434.student.uu.se> MIME-Version: 1.0 Content-Type: text/plain;charset=us-ascii;format=flowed User-Agent: Turnpike/6.07-M (<8x$$+Hd077fJG5diVKxNqJY9rQ>) NNTP-Posting-Host: 83.104.138.185 X-Complaints-To: abuse@demon.net X-Trace: 1376234416 83.104.138.185 (Sun, 11 Aug 2013 15:20:16 UTC) NNTP-Posting-Date: Sun, 11 Aug 2013 15:20:16 UTC Date: Sun, 11 Aug 2013 16:15:59 +0100 X-Received-Bytes: 3107 Xref: news.eternal-september.org comp.lang.ada:16805 Date: 2013-08-11T16:15:59+01:00 List-Id: Once again a thread in this news group shows a polarisation of mind sets concerning right and wrong approaches to writing a program. I am reminded of my teaching days when, even before writing a single piece of Ada code on the white board, I would initiate some class discussion on the question of whether time and duration are same and, if they are not the same, does it matter. I knew I could expect general agreement that the result of adding a pair of time variables was meaningless whereas subtracting such pair of times could be valid, but only if one was aware that the result was not a time. The fun would start when the discussion moved on to questions of how one might detect or, better still prevent, a time/duration program error. If I was lucky, opinions would become quite heated concerning personal responsibility and managerial responsibility should such an error reach a production version of a product. When the dust began to settle I would ask whether it might no be useful if such an error could be detected at compilation time. Sometimes there would be a small minority who would greet that question with incredulity. More interesting to me was identifying those who showed an interest in how this might be achieved in well written Ada and, in comparison, those who were sufficiently sure of their own capabilities that they could regard any additional lines of defensive coding in any language as an unnecessary irrelevance. Worse still were those who would be deaf to the idea that although additional lines of declaration source code can be expected to change the resulting executable code that does not necessarily mean a change of the amount of generated execution code nor necessarily a change of execution times. -- Knowledge is knowing a tomato is a fruit Wisdom in knowing not to put it in the fruit salad. Mike