A collection of articles, ideas, and rambling from a guy who wrote some software that one time.

Friday, August 25, 2006

Scientific Method(ology)

I'm an empiricist at heart.  It's hard to integrate the principles of scientific discovery into one's daily life; while it makes for a good ontological basis for existence, it has the unfortunate side-effect of being damned expensive to apply consistently.  Still, I try when I can.

Recently it occurred to me that UQDS (Divmod's development methodology) has a striking similarity to the scientific process.  I can't find something that neatly lays it out like I remember learning it in school, but wikipedia has a very nice treatment of the whole process.

As I understand the process of scientific knowledge acquisition, there are four phases:


  • A hypothesis is developed, which is an idea that might possibly be true.

  • An experiment is designed, and performed, to test the hypothesis.  if the experiment fails, a new hypothesis is designed.

  • The experiment is documented in a paper and published, and the publication is subjected to peer review by other scientists; the experiment is repeated.  if the experiment can't be repeated, the experiment must be re-designed to eliminate errors or an alternative hypothesis designed to take errors into account.

  • The hypothesis is accepted as a fact, which may be later be used to develop a model, theory, or even a law.


I know a few of my scientist friends out there might read this, so I want to be clear that I'm not proposing that this is what scientists do: scientists do a lot of things. this is the merest subset of the process required for things to be accepted as "scientific fact", and only in the abstract sense.  Different scientific communities have different official standards.  Still, any new scientific discipline would probably have to start with these rules first to be considered "science", and then probably develop additional ones later.

UQDS corresponds rather directly, as if a code repository were its own particular branch of science.


  • hypothesis: a ticket is created, which is a feature which may be possible to implement correctly.

  • experiment: a branch is developed, which includes test cases.  here, as the test cases fail, the branch is refined and the ticket adjusted, much as the hypothesis must be adjusted.

  • peer review: well, uh... peer review.  Another developer reviews the branch, and verifies that the tests test the hypothesis, runs the tests (replicates the experiment) to verify that they pass for them as well, possibly in a different environment, and reports their findings as well.  If the tests fail, the branch must be adjusted more.

  • fact: the changes are then accepted for merging, where they are incorporated into the codebase, which corresponds to the scientific body of knowledge.

Monday, August 14, 2006

The Web One Hundred Point Oh Challenge

I haven't had much time for blogging lately, so rather than post my musings, here are some questions. I credit these to a combination of Iain M. Banks, r0ml, and the Long Now foundation Please comment and post a link to your blog if you write about one of these.

What kind of a program would take one hundred years to write? How would one manage such a project? How would you manage planning and estimating at that scale?

What if you had to write a program that would only be run once, but was supposed to run forever - could never, ever crash, notwithstanding hardware failures? That was expected to outlast humankind on earth? What would such a program do? How would you test it?

What if you had to write a program that would be maintained for ten thousand years - how would you factor it so that the lower levels could still be improved without breaking anything? What would the release process for modules look like? Imagine that you had inherited a program that was ten thousand years old but had never been designed to be maintained this way?

Finally - how does thinking about these problems of heretofore impossible scale affect the way you write programs today?

Update: I forgot to mention Alan Perlis's Epigram #28.

Thursday, August 03, 2006

a scheme program

some jerk is not learning about functional programming

(define (parse callback)
(lambda (data)
(if (>= (string-length data) 10)
((parse (callback (substring data 0 10))) (substring data 10))
(lambda (moredata)
((parse callback) (string-append data moredata))))))

(define (make-line-writer n)
(lambda (line)
(display (format "~A: '~A'\n" n line))
(make-line-writer (+ n 1))))

((((((parse (make-line-writer 1))
"hello") " world") " radix") " is") " dumb!!!!!!!!!!!!!!!")

Update: In addition to not being buggy, I've changed it so that this version is actually functional as well.
Update 2: Forgot the formatting change in the last update.