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-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,d89b08801f2aacae X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-04-30 10:35:40 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!news-out.visi.com!hermes.visi.com!newsfeed1.earthlink.net!newsfeed.earthlink.net!stamper.news.pas.earthlink.net!newsread1.prod.itd.earthlink.net.POSTED!not-for-mail Message-ID: <3CCED601.51299E74@earthlink.net> From: "Marc A. Criley" Organization: Quadrus Corporation X-Mailer: Mozilla 4.73 [en] (X11; U; Linux 2.2.14-5.0 i686) X-Accept-Language: en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Is strong typing worth the cost? References: <4519e058.0204290722.2189008@posting.google.com> <3CCE8523.6F2E721C@earthlink.net> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Date: Tue, 30 Apr 2002 17:35:38 GMT NNTP-Posting-Host: 158.252.122.197 X-Complaints-To: abuse@earthlink.net X-Trace: newsread1.prod.itd.earthlink.net 1020188138 158.252.122.197 (Tue, 30 Apr 2002 10:35:38 PDT) NNTP-Posting-Date: Tue, 30 Apr 2002 10:35:38 PDT Xref: archiver1.google.com comp.lang.ada:23285 Date: 2002-04-30T17:35:38+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? > > > strengths of strong typing. Don't fight strong typing, USE it! > > Why? Can you prove to me that the benefits will be greater > than the costs? > > Why am I asking for this evidence? I am working on a detailed > analysis of C that includes material on coding guidelines. > I have set myself the target of basis these guidelines on > empirical evidence. I am a fan of strong typing. However, > unless I can find any evidence to the contrary, the most I > can say at the moment is "some people think ...". I understand what you're trying to do here, and applaud your motivation to find empirical evidence on the cost/benefits of strong typing. But there's like a problem with the concept of programming with or without strong typing, particularly in a language that is built upon it, like Ada. So I have difficulty characterizing what such a study would demonstrate, which may suggest why one focused exclusively on that topic is difficult to find. I find the idea roughly analogous to talking about the costs/benefits of using classes in C++. Classes are a fundamental part of that language, so avoiding them would mean performing "programming acrobatics" and the resulting software would certainly not adhere to the "spirit of C++". It can be done, but what has it proved? Likewise, strong typing is a fundamental part of Ada, so if you avoid strong typing, you're not really programming in Ada. This is what I was alluding to in the posting about how programmers can embed and extract information in software written in a strongly typed programming language. Ada semantics are a manifestation of a "type model", and it's very difficult to answer the question: "What would programming in this language be like if it wasn't based on a strong typing model?" What are the costs of strong typing? Well, the aspects of this question must be better defined... Are you (the generic "you") talking about the time required to fix constraint errors caused by exceeding an index range? I've known developers and managers who hated exceptions, because they ended up costing time and money. Yet I see the raising of such exceptions as a benefit of strong typing! Is there a cost associated with the analysis to properly define a type range with minimum and maximum values that can then be extracted via 'First, 'Last, and 'Range? Well, if I don't embed that information in the type definition, then I'll need to maintain variables or constants (whose values I also had to determine via analysis). A study tossed at me decrying strong typing as more cost than benefit would have to clearly identify what they're calling "strong typing", what criteria are being used to measure cost and benefit, and be evaluating strong typing in a sensible environment. I.e., claiming that strong typing has more cost than benefit when programming in C or BASIC probably wouldn't give me much heartburn, because those are not strongly typed languages, and therefore emulating strong typing would be an added development cost, and depend on the standards of the project, and the commitment and skill of the application developers. When it comes to strong typing, Ada has spoiled me, and any sort of analysis of strong typing will have to provide support and rigor equal or exceeding that provided by Ada. Marc A. Criley Consultant Quadrus Corporation www.quadruscorp.com