News for hackers. Stuff that matters.
Re:Things I learnt by not writing tests by silentbicycle on Friday January 08, 2010 @02:26PM (#1040213)
In some cases, couldn't the tests be the code? That's the declarative programming ideal, anyway - starting with a straightforward spec of the problem, running it, and then gradually fleshing out just the parts that need to be optimized. Sometimes, writing what I want and then writing step-by-step directions for how to do it feels like I'm repeating myself.

Prolog is far from perfect (its default search mechanism gets stuck in left-recursive clauses), but it's a start, and computers have gotten considerably faster since the 70s...

AFAIK, the best known success of declarative programming is writing a pattern matching specification (with ML, Prolog, Erlang, Haskell, or various Lisp macros) and compiling it to the necessary nested if / switch statements, rather than generating it by hand. I guess it overlaps with parser generators, and some other DSLs, too.

There are no comments on this comment yet.