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 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,d89b08801f2aacae X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-04-30 21:00:14 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!guinness.news.atl.earthlink.net!murphys.news.atl.earthlink.net!newsfeed0.news.atl.earthlink.net!news.atl.earthlink.net!news.mindspring.net!not-for-mail From: Richard Riehle Newsgroups: comp.lang.ada Subject: Re: Is strong typing worth the cost? Date: Tue, 30 Apr 2002 21:01:42 -0700 Organization: AdaWorks Software Engineering Message-ID: <3CCF68A6.F984E649@adaworks.com> References: <4519e058.0204290722.2189008@posting.google.com> <3CCE8523.6F2E721C@earthlink.net> Reply-To: richard@adaworks.com NNTP-Posting-Host: 41.b2.61.4f Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Server-Date: 1 May 2002 03:59:51 GMT X-Mailer: Mozilla 4.7 [en] (Win98; I) X-Accept-Language: en Xref: archiver1.google.com comp.lang.ada:23311 Date: 2002-05-01T03:59:51+00:00 List-Id: dmjones wrote: > The real problem with the discussion so far is that it has > only mentioned the benefits. What about the costs? When developing software with a significant dependability requirement you may want to believe you cannot afford type safety. However, in the words of an insurance agent, when told by a prospect he cannot afford to buy a particular kind of insurance, "Mr. Jones, you can't afford not to buy this policy." What level of insurance do you want to offset the risk when delivering a reliable system on-time and within budget? Perhaps, when assessing cost, we might say, "Mr. Jones, you can't afford not to use type safety." It is not clear what costs you mean. It is also not clear what you mean by "strong typing." A type is characterized by: A type name A set of values A set of operations A set of rules relative to objects of other types Nearly every language has types. Therefore, nearly every language has some level of type safety. I think what you mean by strong typing is the rigor of type safety. Even COBOL has a certain amount of type safety. For example, one cannot add a PICTURE XX to a PICTURE 99. Is there a cost associated with type safety? Is there a corresponding cost associated with lack of type safety? In Ada, type safety begins earlier in the development process than in most languages. For small, programs, extensive reliance on type safety is probably overkill. As an application gets larger, type safety tends to scale nicely with the demands and complexity of that larger set of code. The cost of resorting to the debugger, examining lots of cross-reference listings, and prowling through hexadecimal dumps can be expensive on large-scale software. So the cost of type safety, if there is a cost, on small, relatively easy programs may not not offset the ease of invoking debugging tools. But as that program grows, and as more programmers work on modules that must interface with each other, the cost of type safety tends to be cancelled out by the cost of debugging efforts. Richard Riehle