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=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,3315dcc90287cdfa X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newscon06.news.prodigy.com!prodigy.net!newsmst01b.news.prodigy.com!prodigy.com!postmaster.news.prodigy.com!newssvr12.news.prodigy.com.POSTED!4988f22a!not-for-mail From: Newsgroups: comp.lang.ada References: Subject: Re: Mutations and type usage in Ada X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1437 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441 Message-ID: NNTP-Posting-Host: 70.134.122.134 X-Complaints-To: abuse@prodigy.net X-Trace: newssvr12.news.prodigy.com 1140322405 ST000 70.134.122.134 (Sat, 18 Feb 2006 23:13:25 EST) NNTP-Posting-Date: Sat, 18 Feb 2006 23:13:25 EST Organization: SBC http://yahoo.sbc.com X-UserInfo1: TSU[@I_AOHV[RVT[AROR__TDFZ\@@FXLM@TDOCQDJ@_@FNTBLNTC@AWZWDXZXQ[K\FFSKCVM@F_N_DOBWVWG__LG@VVOIPLIGX\\BU_B@\P\PFX\B[APHTWAHDCKJF^NHD[YJAZMCY_CWG[SX\Y]^KC\HSZRWSWKGAY_PC[BQ[BXAS\F\\@DMTLFZFUE@\VL Date: Sun, 19 Feb 2006 04:13:25 GMT Xref: g2news1.google.com comp.lang.ada:2977 Date: 2006-02-19T04:13:25+00:00 List-Id: "Derek M. Jones" wrote in message news:aY2If.25669$i2.16979@newsfe6-gui.ntli.net... > All, > > To what extent will Ada type checking cause mutated > programs, where some of the variables have been changed, > to be flagged at compile time? > It is not entirely clear what problem you are trying to solve. > > Whether or not a change of variable will result in a compile > time error will depend on the extent to which a program makes > use of the Ada type system. For instance, if all my variables > have type integer then the switching them around is unlikely > to generate a compile time message. > In Ada we would typically eschew the use of predefined types for production code. The Integer type is useful for student and toy programs but not for serious programs. Often, we will specify not only the range of the type but also supply a representation specification to define its bit size. > > My experience with Pascal (yes, Pascal is not Ada) was that many > programmers would not spend the time needed to think about the > type that needed to be created. Perhaps some of these people have > been sucked into Ada and managed to avoid the 'type safety' thought > police :-) > What a strange phrase, "type safety thought police." The objective, I would hope, is to produce the most dependable software we can. We want to solve the right problem and we want to solve it correctly. Further, we want to include all the controls over that solution that will ensure it will not inadvertantly go awry during operation. Ada provides a variety of tools for ensuring dependability. Those tools include type safety and visibility safety. The language tools alone are not sufficient for ensuring dependability. We still need inspection by humans, testing, and lots of other tools that are outside the language. In the case of Ada, correct use of the tools provided by the language, including type safety, can help in the use of those other tools. If you are simply concerned with writing a program according to your own best understanding of the problem, you might use any language tool or limited set of tools you wish. On the other hand, if you are concerned with an engineering view of the problem, which includes the long-term maintenance of the solution, it is only proper to choose your tools wisely and use them correctly. Introducing phrases such as "type safety thought police" is both irresponsible and silly. It reflects a narrow view of what software engineering is about and has the potential for leading astray those newcomers to software engineering that need to be prepared for correct use of all the tools available to them in their work. Richard Riehle