[Haskell-cafe] Language extensions

Ketil Malde ketil at ii.uib.no
Wed May 30 03:17:09 EDT 2007


On Tue, 2007-05-29 at 21:39 +0100, Andrew Coppin wrote:

> My point is for most programs, trying to figure out exactly what you 
> want the program to do is going to be much harder than implementing a 
> program that does it.

And the solution is..to not say anything about what the program should
do? :-)

> Also, for most programs the spec is far more complicated (and hence 
> prone to error) than the actual program, so...

Since the program *is* a (complete) specification of itself, a
specification need not be any longer or more complicated than the
program.

Realistically, I think it is good practice to specify explicit type
signatures and quickcheck properties (or similar unit tests).  The
advantage over other documentation, is that they are verified or tested
(respectively) against the actual code.

The code itself explains "how", type signatures and unit tests explain
"what", which leaves only "why" to comments.

-k



More information about the Haskell-Cafe mailing list