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-05-26 15:04:15 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!bloom-beacon.mit.edu!iad-peer.news.verio.net!news.verio.net!iad-read.news.verio.net.POSTED!bpr.best.vwh.net!bpr Newsgroups: comp.lang.ada From: Brian Rogoff Subject: Re: Is strong typing worth the cost? In-Reply-To: <3CF1231F.6000609@attbi.com> Message-ID: References: <4519e058.0204290722.2189008@posting.google.com> <3CCE8523.6F2E721C@earthlink.net> <3CCEB246.9090009@worldnet.att.net> <3CCFFB7F.B8080F7A@despammed.com> <3CD1608B.A6336379@despammed.com> <3CD176D5.31892591@otelco.net> <3CF1231F.6000609@attbi.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Date: Sun, 26 May 2002 22:04:11 +0000 NNTP-Posting-Host: 192.220.65.223 X-Complaints-To: abuse@verio.net X-Trace: iad-read.news.verio.net 1022450443 192.220.65.223 (Sun, 26 May 2002 22:00:43 GMT) NNTP-Posting-Date: Sun, 26 May 2002 22:00:43 GMT Organization: Verio Xref: archiver1.google.com comp.lang.ada:24840 Date: 2002-05-26T22:04:11+00:00 List-Id: On Sun, 26 May 2002, Robert I. Eachus wrote: [...snip...] > What I guess I, and a lot of other here feel is that there is no > question there worth asking. Comparing the cost of developing an > incorrect version of a program to the cost of developing a correct > version is meaningless. And all Ada programmers know from personal > experience that strong typing finds bugs in our code at compile time > that would be much more difficult to find using the debugger. Being, with you, on the side of strong *static* typing, I find that a more interesting question to ask is to what extent should the typing be explicit (in Ada, it's almost all explicit) and to what extent should the language allow implicit typing, like most modern functional languages. Another related question I'd like language designers to think about is the relationship between verbosity and readability. It's often insinuated in the Ada community that verbosity and readability are directly proportional, but I don't believe that's true. If we look at the history of mathematics, there was a period of time when mathematicians wrote mathematics like prose, and it was a big advance to get more succint notations. Just making it like prose does not enhance readability, especially when the underlying ideas are just inherently difficult, as with mathematics. > In fact, there is a very good clue that has been intertwined with this > discussion... C programmers will compile their code with debugging > options enabled, then run it first via the debugger. Ada programmers > tend to compile with debug options turned off, and personally I have > never used the debugger that comes with GNAT. (I did use the Verdix > debugger a few times though.) I have the same experience with OCaml, though I admit I've used the debugger when I didn't catch some generic exception like "Not_found" and I get some bad data. That's just my own fault for being lazy. Mostly, I've learned to write my programs so that as many errors as possible are type errors. What I really wish for now is a powerful dependently typed system, though of course at that point checking becomes undecidable, like C++ templates before that iteration depth limit was imposed... -- Brian