Terrence Brannon wrote:
RE: http://www.jsoftware.com/help/primer/basic_list_adding.htm
I think it would be nice to poke people's memory with a for_item. based
example
instead of just using while.
Maybe it would be nice to preface this example (
http://www.jsoftware.com/help/primer/basic_list_adding.htm)
with big red letters saying "DON'T DO THIS".
At least the text ought to
provide a hint early on that "the way one would do this in BASIC" is
ridiculously
complicated compared to how we do this in J, i.e. point out that the
page following
(http://www.jsoftware.com/help/primer/j_list_adding.htm) this one obviates
everything on it.
I am now working on a paper for APL2007 in which I hope to provide examples
of the clarity loopless
programming provides compared to the more conventional variety - the "list
adding" page might well
serve as a simple example of this. However, this case is so simple it is
vulnerable to the "array operations
are _only_ syntactic sugar" argument.
Other examples I'm thinking of using are: showing how the first six chapters
of the book
"Accelerated C++" (by Koenig and Moo) can be rendered in perhaps six lines
of J, and a potential
re-write of a Markov Chain example (see "shaney.py" at
http://www.strout.net/python/tidbits.html)
in an array fashion. (See also http://en.wikipedia.org/wiki/Mark_V_Shaney).
If anyone can provide any other good illustrations of this, I'd be grateful.
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm