Just a few comments: what does CSP stand for (and why isn't it defined in the comment)?
You are siding with the majority but would it kill you to use names of more than one letter? I agree with Raul on no space before the copula for ease of locating assignments - which is another reason to use more than one letter per name. On the other hand, I'm pleased to see explanatory comments before most assignments. It's neater to use local assignment within a verb definition to avoid cluttering your namespace with intermediate values - I'm not sure if you're mixing up locals and globals for some reason within the definition of "revise". Also, as you develop this into a larger suite of names, you should put some thought into a meaningful name for a namespace in which to encapsulate this code. I usually precede the basic intro comment of a definition by "NB.* " and I believe some others do as well. I've found this convention handy for when my script gets large enough to warrant a table of contents - I can just grep for the "NB.*" lines and stick that result at the top of the script. You can see what this looks like here: http://www.jsoftware.com/jwiki/DevonMcCormick/Utilities . I'm glad to see someone working on graph verbs. Keep up the good work! On Fri, Nov 2, 2012 at 1:38 PM, David Ward Lambert <[email protected]>wrote: > If your program works I'd say you aren't doing something wrong. > Raul Miller proposed a naming convention which I've found useful. In > short: > > NOUN Conjunction Adverb verb > > I think you'd do well to next learn the ~ adverb, reflex/passive. > And someday you'll run across the "special code" page: > http://www.jsoftware.com/help/dictionary/special.htm > These are phrases that occur often enough to warrant c code to speed > their operation. > > Congratulations! > > > > Date: Thu, 1 Nov 2012 22:01:41 -0700 > > From: "Michal D." <[email protected]> > > To: [email protected] > > Subject: [Jprogramming] Arc consistency in J > > Message-ID: > > <CAO37ydBc2LP8ERHXVOYRsjHZ3apx9T3 > > [email protected]> > > Content-Type: text/plain; charset=ISO-8859-1 > > > > Hi All, > > > > I've managed to write my first not-completely-trivial program in J. > > It > > implements an arc consistency algorithm ( > > http://en.wikipedia.org/wiki/Local_consistency#Arc_consistency). I > > would > > appreciate any comments regarding style, what I'm doing wrong in J or > > how > > to improve the code. > > > ---------------------------------------------------------------------- > For information about J forums see http://www.jsoftware.com/forums.htm > -- Devon McCormick, CFA ^me^ at acm. org is my preferred e-mail ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
