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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 109fba,b87849933931bc93 X-Google-Attributes: gid109fba,public X-Google-Thread: 1108a1,b87849933931bc93 X-Google-Attributes: gid1108a1,public X-Google-Thread: 103376,b87849933931bc93 X-Google-Attributes: gid103376,public X-Google-Thread: fac41,b87849933931bc93 X-Google-Attributes: gidfac41,public X-Google-Thread: 114809,b87849933931bc93 X-Google-Attributes: gid114809,public From: fjh@mundook.cs.mu.OZ.AU (Fergus Henderson) Subject: Re: OO, C++, and something much better! Date: 1997/01/24 Message-ID: <5caqo5$k5l@mulga.cs.mu.OZ.AU>#1/1 X-Deja-AN: 211931713 references: <32DF458F.4D5C@concentric.net> <32DF94DC.6FF8@watson.ibm.com> <32DFD972.37E4@concentric.net> <5bphq4$5js@mulga.cs.mu.OZ.AU> <32E05FAF.47BA@concentric.net> <5buodl$bci@boursy.news.erols.com> <32E2FEC7.2F7B@concentric.net> <5bvncj$gqg$1@A-abe.resnet.ucsb.edu> <32E47B4B.56D9@concentric.net> <5c4fr0$27j@mulga.cs.mu.OZ.AU> <32E67751.4AFC@parcplace.com> organization: Comp Sci, University of Melbourne newsgroups: comp.lang.c++,comp.lang.smalltalk,comp.lang.eiffel,comp.lang.ada,comp.object Date: 1997-01-24T00:00:00+00:00 List-Id: Eric Clayberg writes: >Fergus Henderson wrote: >> My experience is that errors caught by type checking constitute a LOT >> more than 2% of errors. >> For a period of time I carefully recorded the cause of every error that >> I found while writing a Mercury program. Of the 155 errors that I >> recorded, 73 were error caught by the type checker. While reexamining my list, I noticed that I had accidentally misclassified one class of errors containing 3 errors, so the number 73 above should have been 70. Sorry about that. >If anything, I think that reflects poorly on the syntax of whatever >language you were using. Some (14) of those 70 errors were related to the syntax, but most of them were errors such as "wrong number of arguments", "wrong procedure name", and so forth, that could occur in just about any language. Note that the number 70 does *not* include errors in the type declarations themselves; there were an additional 13 of those. Here's a more detailed breakdown. syntax errors: 16 type errors: 83 - errors in type declarations: 13 - type errors other than errors in type declarations: 70 - syntax related: 14 - wrong procedure name: 11 - wrong constant name: 4 - wrong variable name: 4 - wrong number of arguments: 21 - incorrect argument order: 5 - argument has wrong type: 7 other errors detected at compile time: 47 - missing `import_module' declarations: 7 - errors in mode declarations: 13 - others: 27 errors not detected until run time: 9 The "syntax related" errors all relate to a particular aspect of Mercury syntax: calling and defining procedures that have implicit side effects uses a different syntax than is used for procedures which do not have any implicit side effects. This is clearly an error-prone aspect of the syntax, but it enhances readability. Of the "syntax errors", 10 were caused by missing or additional commas; this class would probably not occur if Mercury syntax used say `;' as a statement terminator rather than `,' as a statement separator. -- Fergus Henderson | "I have always known that the pursuit WWW: | of excellence is a lethal habit" PGP: finger fjh@128.250.37.3 | -- the last words of T. S. Garp.