Sunday, February 08, 2009

The Zen of Jess 2009: Part I
by Jason Morris

Jess and the Art of (Safe) Rule-Based Computing

I’ve noted that new Jess users are highly susceptible to the viral coding malady, scribo precoxium (SP), roughly translated from Latin as “to write prematurely”. Most poor souls who contract scribo precoxium come from relatively weak Java backgrounds. Their bookshelves are devoid of the names Giarratano, Riley, Russell, Norvig, and Jackson, though the sharing of books with the phrases “head-first” or “in a nutshell” seems to be higher among the population of scribo precoxium sufferers. The typical progression finds casual coders hanging out in unmoderated forums leading to libri indifferens, or an indifference to reading reference material. Longer exposure gives way to outright Documentational Disaffective Disorder. In no time, victims are attempting complicated Jess applications without first doing any homework, and once they start writing a little code, the urge to continue cannot be controlled. Soon, they are left exasperated, due dates looming, with piles of uncompilable source. First responders on the scene often report victims face down in puddle of Mountain Dew, comatose from trying to ease their pain by mainlining a snowball of Jess and Drools.

Professionals are less susceptible than academics to SP, though even the most seasoned veteran of many product cycles has been known to contract it. As trained help providers, we on the Jess list server are keen to spot the warning signs. Typical symptoms of SP include severe external pleading such as, “Help me please!” and “I can’t get this to run!”. Often, there is an additional appeal for assistance by a certain date such as, “I need to make this work by tomorrow!!” or something similar.



What can be done?

Fortunately, there is a time-tested treatment for combating scribo precoxium: RTFD. When given intra-occularly, RTFD has been proven in the vast majority of cases to eliminate the symptoms of SP overnight. Small doses of RTFD, taken daily, can prevent the reoccurrence of scribo precoxium. Left untreated, SP can metastize into full-blown molestus neophytus which can impair your hearing, judgment, and ability to take sound programming advice of any kind. In the most serious cases, patients are have been known to develop an owen-oma, an ulcerated rip midway between their eyes and halfway up their forehead.

So, don’t hesitate to write Dr. Friedman-Hill if you need your RTFD prescription refilled.

A New Beginning

All kidding aside, in the five years since I first wrote The Zen of Jess, Jess has acquired a significant body of questions and answers on the Jess email list. Most of these answers come from Dr. Friedman-Hill himself, and though I originally opined that he must be frustrated in having to answer questions that he has taken great pains to answer elsewhere, one would never know it for the effort that he makes ensuring that every question, however “noobious”, is answered. It has occurred to me that despite all the warnings, admonitions, and evidence to the contrary, there are those for whom the cart must come before the horse. So, in keeping with our great Madame Speaker’s penchant for prevention of communicable diseases such as scribo precoxium, I shall advocate a policy of Prophylactic Programming.

Lest you contract SP, keep in mind that using Jess is not so simple as including another JAR in your application. Jess is in many ways a meta-tool, that is a tool for building tools – in my case rule-based expert systems. For many new Jess users, declarative programming will be a completely alien paradigm that warrants a careful and thoughtful study before attempting to write serious code.

We'll delve into what that entails in Part II. - JM

1 comment:

woolfel said...

Just make sure you use Trojan brand. I hear they are tested to be 99% effective when used properly.

On a less silly note. Developers often don't read the manual because they are so used to poor documentation that often it doesn't help. In the case of jess, the documentation is good, but it really needs a good index. this way developers can quickly lookup by topic.