Hi,

I was working in embedded development, writing lots of C code. My
primary tool for debugging things was turning an LED on or off. So, I
became quite interested in figuring out how to write code with less
bugs.

After some searching, I found lclint, (now knows as splint:
http://lclint.cs.virginia.edu/). lclint performs static analysis on C
code to find things like uninitialized variables, memory leaks, and
tons of other stuff. In order to get the most out of it, I had to
annotate my code like this:

extern char *gname;
extern /[EMAIL PROTECTED]@*/ isNull (/[EMAIL PROTECTED]@*/char *x);

void setName(/[EMAIL PROTECTED]@*/ char *pname)
{
  if (!isNull (pname)) { gname = pname; }
}

Although marking up the code was a bit tedious, the amount of errors
that it caught was astounding. And, typically, my code actually worked
on the first try after I fixed anything lclint complained about.

I decided that this thing static error analysis stuff was pretty
spiffy and set out to look for a language that had it built-in by
default. I originally started with Concurrent Clean 1.x, but
eventually settled on Haskell (GHC 5.04) for reasons I do not
remember. I think it may have been because Haskell seemed to have a
bigger, more active community (which is still true today).

j.
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to