On Wed, 2012-02-01 at 10:43 +0000, Sam Aaron wrote:
> On 30 Jan 2012, at 17:07, daly wrote:
> > 
> > The key result was that I discovered what I call my personal
> > "irreducible error rate". If I do 100 things I will make 3 errors.
> > This was independent of the task. So typing 100 characters has
> > 3 wrong letters which were mostly caught while typing. Writing
> > 100 lines of code had 3 errors somewhere. Composing email
> > introduces 3 errors per 100 lines of code.
> 
> I wonder if that rate has changed since the time you measured it. 
> 
Unfortunately not. However I am now able to identify several
errors that I continue to make. The 2/3 keys get mistyped.
The _/+ keys get mistyped. I seem unable to overcome this.
Which is really bad considering my hobby is computer algebra.

The largest contribution to my errors is using copy/paste.
It is responsible for about 50% of all errors. If I could
convince myself to stop using it my error rate would drop.
On good days I don't use it but I get lazy.

Curiously I do have a lower error rate in Lisp than I do in
other languages. In C, for instance, I get caught by things
like float to double conversions on calls, despite knowing
about it. In Java I miss the null case checks despite being
aware that Java is brain-dead about null. In Python I skip
"self"ing things. In Javascript I miss the 'var' occasionally.

Lisp "just works" and works just as I expect. It eliminates
whole categories of errors. (The most annoying thing about
Clojure is the "null pointer exceptions" from Java.) When
I want solid, correct code I reach for Lisp. For random
segment faults, C. For heap exhaustion or null pointers,
Java, etc. Rich did a marvelous thing by forcing alter to
require dosync. It eliminates a whole class of errors. 

When I find a mistake I still try to find the root cause.
Then I try to change what I do so the mistake cannot exist.
This changes the type of possible errors but the 3% is still
there. I just make "more sophisticated, higher level errors".
I am hoping that Literate Programming will raise my errors
to truly epic proportions :-)

One of my personal motivations for literate programming is
to eliminate errors. I have no tool that will catch errors
in reasoning, missing cases, bad design, mindless stupidity,
and horrible inefficiency. Writing an explanation of the
code is the best way I have found to catch errors of this
kind. 

One of Rich's stated motivations for Clojure was that he
found concurrent programming in various languages to be
very error prone and wanted to create a language that would
eliminate concurrent errors. In some sense, we are trying
to achieve similar goals.

So Literate Programming is not about tools. It is about a
change in mindset. I want to be a better programmer and this
is an effective tool to help me generate higher quality (ie
less buggy) code.

Tim Daly


-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to