Chasing the Declarative Wild Goose

Recently at work, I've been part of a committee that is trying to figure out a strategic plan for implementing various features. The features are all big and hefty, with several possible implementation paths, and our goal is to try to avoid the kind of schizophrenic codebase that can result from solving every problem on a case by case basis, with no thought given to the possible simplifications and generalizations. Because this committee is thinking about features that may guide the company for the next year or two, I have to remain vague about what exactly the features are, but I wanted to try to share a lesson that I've been learning. Hopefully the vagueness won't make the lesson incomprehensible.

After considering the broad range of features that we wanted to tackle, we realized that about half of them could be solved all at once, as mere instances of a broader problem. Solving the broader problem, however, appeared to be somewhat of a research project. It wasn't clear whether we would be able to come up with a good solution, or whether it would turn into a tarpit.

So I started diving into more detail about how exactly the broader solution would work. After two days and eleven pages, I realized that it was basically a kind of abstract interpretation. Unfortunately, that meant that it would forever be incomplete (abstract interpretation always has a tension between precision and decideability). This was the first bad omen. Nevertheless, I continued on for a while, hoping that I could come up with some sensible subset of the feature that would be complete enough to be useful, yet still decideable.

Bad omen number two was when I realized that a part of our system that had previously been ultra-lightweight and stateless would suddenly have to either maintain an unbounded amount of state or else sacrifice some degree of correctness. I explored a few alternatives for bounding the size of the state, but eventually decided that there really was no natural boundary.

Bad omen number three was when I realized that because the new feature was intricately involved with the concept of time, the rest of the system would have to be very careful with the parts of our system that did involve storing state. This is because storing information as state effectively delays the flow of time -- so you end up having to store some kind of meta-state as well. Furthermore, in some cases, the correct handling of state seemed to require arbitrarily complicated heuristics in order to achieve correctness.

At this point I stopped diving, and showed what I had so far to the rest of the group. They recoiled in horror, and the feature ended up shelved.

Why did this feature fail? I think that's an important question to ask. One of the other members of the team had said from the beginning that he thought the feature would turn out to be infeasible. Why had he recognized this so early, even though nobody else had?

The answer that I've been coming up with is that the feature was fundamentally declarative, rather than imperative. By that I mean that the feature amounted to announcing some fact to the computer, and expecting the computer to react "in any appropriate way". I contrast this with an imperative approach, where you come up with a well-defined mechanism, and you can immediately see which problems it will solve and which it won't.

Here's an example that might help explain the distinction. Suppose you announce to a Windows XP machine that "This file shall be read-only from now on". In response to this proclamation, you expect the machine to do things like disable selection of that file in the "Save" dialog, have notepad flush its in-memory buffers if it happens to have the file open for editing, mirror the file to multiple remote locations just in case the local copy gets corrupted, add it to the list of read-only files maintained on the company intranet, etc, etc.

In one sense, the statement that "this file shall be read-only from now on" is very well-defined and comprehensible. Humans may think they know all of the things that that should entail. But from the computer's perspective, the possibilities are endless. You essentially have to revisit each and every piece of software on the machine, and imagine how it might be affected. And some of those decisions might not have any clear and definitive answer other than "whatever I happen to want". In short, it pretty much requires some form of AI.

I think that software engineers may have a peculiar vulnerability to this kind of folly. We're used to thinking up requirements, and then expecting that there will be some kind of reasonable implementation path, even if it may be difficult and involved. But there really are two kinds of requirements: requirements about well-bounded mechanisms, and requirements about unbounded declarative invariants. "Go through these motions" versus "make sure P is true". Constructive proofs versus existential ones.

I'm beginning to think that one of the main skills of a good architect is to be able to recognize the difference between these two kinds of requirements, and avoid the ones that smell like AI, or like formal proofs of turing-complete systems. I think that I have a natural tendency to try to chase the declarative wild goose, and that that tendency has been responsible for the demise of several of my spare-time projects. I'd like to think that I'm starting to be able to recognize that tendency in myself, and hopefully I'll be able to start avoiding it in the future.

Posted on April 26, 2005 02:11 PM
More languages articles

Comments

People all over the world know the abercrombie and fitch,but not everyone really knows how fashion the abercrombie is,hollister is the Legend maker. Everybody wears the hollister clothing would be the abercrombie mensand the abercrombie womens, if you want know you can search the Ruehl No.925 or abercrombie outlet in the www.google.com .

Posted by: anf at November 13, 2009 12:37 AM

Uggs on sale now.UGG Classic Cardy Boot makes me different form the other

girls. The UGG Bailey Button Boot is a good choice for female.

Posted by: ugg classic cardy boots at November 17, 2009 12:53 AM

The 39.html">classic cardy uggs boots is another hot boots that worth of buying.And the classic tall ugg boots
will make your winter amusing.And now uggs on sale,if you are looking for such a boot,the ugg boots is good choice this year.

Posted by: UGG Bailey Button Boots at November 17, 2009 01:00 AM

www.enjoywholesale.com

china wholesale clothing,china wholesale shoes,china wholesale electronics,china wholesale suppliers,china manufacturers

china wholesale products,light in the box,wholesale lots,wholesale ipod
china direct,china dropship,china trade,made in china

electronics wholesaler,ebay wholesaler,financial wholesaler
fashion wholesaler,clothing wholesaler,wholesaler magazine

computer wholesaler,external wholesaler,dvd wholesaler,wholesaler definition,china wholesaler,mutual fund wholesaler,define wholesaler,insurance wholesaler


discount ugg boots
forture
ugg boots
Discount store

Posted by: wholesaler business website, net shopping site, external wholesaler,dvd wholesaler,wholesaler definition,china wholesaler,mutual fund wholesaler,define wholesaler,insurance wholesaler at November 18, 2009 02:58 AM

We are the best online sales for the china wholesale . Here you can have a large of choices of kinds Ugg Boots,Converse Shoes,Timberland Boots,puma shoes,Nike Shox Shoes ,Nike Dunk SB Shoes,Nike Air Max,Links Of London,Tiffany Jewelry,Dior Handbags?,jimmy choo handbags ,Cartier Watches, 8GB Mp4 Players,Bluetooth Car DVDs. All our cheap online cheap goods are high quality and original packages, and best service. We offer our customers the best service, 7 days arrive at your door.Enjoy your easy and happy shopping with us.

Posted by: cheap goods sale. at November 20, 2009 01:34 AM

very pretty,now
Christmas is coming, not have prepare the gifts for your friends? ,Hello! Today I found a website selling
Discount Designer Handbags,
discount Handbags,
Replica Louis Vuitton HandBags ,
Replica Chanel HandBags
,Replica Gucci HandBags ,
Replica Chanel HandBags ,
Replica Coach HandBagsit is so cheap.
LV neverfull.
Gucci Cruise Large Beige Tote
Chanel Hobo Noe

Posted by: fly at November 22, 2009 07:48 PM

Laptop Battery Laptop Battery Laptop Batteries
Laptop Batteries discount laptop battery
discount laptop battery
notebook battery notebook battery
computer battery computer battery
replacement laptop battery replacement laptop battery
notebook batteries notebook batteries

Posted by: Laptop Battery at November 23, 2009 09:59 PM

Ugg Classic Cardy

Boots

Ugg Classic Tall

Boots

Ugg Classic Short

Boots

Posted by: topuggshoes at November 26, 2009 02:44 AM

Just wanted to say great job with the blog, today is my first visit here and Iíve enjoyed reading your posts so far
ugg bailey button
Wow, my ugg classic mini will not be coming off now! Iíve had them on for 12hrs strait and I do not want to take them off. Thanks for everything, well worth the wait.

Posted by: ugg bailey button boots at November 30, 2009 05:53 AM

Spring is near,every girl wants to be the bride in the special season.They are eager to put on beautiful Wedding Dresses or the Bridal gowns.During the day the Wedding gowns is the good choose,and the night,if you want radiant,you need the Evening gowns.
About the bridesmaid,they have to wear Bridesmaid Dresses in order to avoid grab limelight with the bride.And the Flower Girl has the Flower Girl Dresses,too.In the wedding,the Cocktail Dresses and the Evening Dresses is necessary,too!And remember,the Wedding Dress of the Bridal Dress must be the most glaring!

Posted by: weddingdressclub at December 1, 2009 12:25 AM

Buy a pair of womens ugg boots for christmas,women's Classic Boots,tall women and women's classic short are the best choice for you,ugg classic boots on sale and cheap ugg boots on www.uggssky.com that welcome you to have a look!

Posted by: womens ugg boots at December 1, 2009 09:09 AM

Now more and more young people love to wear puma running shoes,due to the puma shoes make you feel more comfortable and more fashionable,buy cheap puma shoes online that you could go to www.ilovepuma.com the puma store to buy
Puma Future Cat,
fluxion ii
or cat puma shoes,high quality and best sprice with free shipping.

Posted by: puma running shoes at December 1, 2009 09:09 AM
Post a comment









Remember info?




Prove you're human. Type "human":