Newsgroups: | comp.compilers |
From: | eifrig@beanworld.cs.jhu.edu (Jonathan Eifrig) |
Organization: | The Johns Hopkins University CS Department |
Date: | Tue, 12 Jan 1993 00:57:55 GMT |
References: | 93-01-041 93-01-065 |
Keywords: | optimize, performance, debug |
nickh@CS.CMU.EDU (Nick Haines) writes:
> 4. Use of a language with a good type system eliminates the
> edit-compile-bomb-edit cycle, ... Typechecking is (in general) much
> faster than compilation because it includes no optimisation or code
> transformations.
In article 93-01-065 jlg@cochiti.lanl.gov (J. Giles) writes:
>Then your programs are considerably different from what I'm familiar with.
>Most errors are not syntactic or static semantic errors (like type
>errors). The vast majority of debugging time is spent isolating and
>correcting problems which are not - and cannot be - found by the
>typechecks no matter how strict your type system is.
Hmmm; well, if this is your experience then it is very different
than mine! I think that my most common coding errors are (in order of
decreasing frequency):
1) Typographical errors, such as misspellings of keywords and
identifiers.
2) Failing to pass parameters to a function in the correct order,
or neglecting to pass all of the necessary parameters.
3) Using "=" for "==", especially after I've been coding in
something other than C for a while! :-)
4) Incorrectly dereferencing some pointer to a complicated data
structure, or incompletely following a chain of pointers.
5) Attempting to add new functionality to a piece of code after
1:00 AM. :-)
6) Bugs in the documentation of system calls and library functions.
7) Being a general bonehead!
Obviously, a typechecker will catch most of the errors of types
1,2,3,and sometimes 4, which probably accounts for 85% or more of the
_errors_ in my code. Of course, since these are so easy to fix, this
probably only amounts to 15% of by debugging _time_. Of course, that is
to the typechecker's credit, not it's detriment. After all, if one had
the Acme Super-Duper Bug Remover, that removed all of a programs bugs in
minutes, you'd say that debugging programs is easy and we should waste our
time talking about it. ;-)
--
Jack Eifrig (eifrig@cs.jhu.edu) The Johns Hopkins University, C.S. Dept.
--
Return to the
comp.compilers page.
Search the
comp.compilers archives again.