OK. But, you cannot offer such justification
with every piece of code.

And in a stranger it may create the same impression
as using redundant parentheses between relational
and logical operators in SQL or C.

Which can tell that you either not sure or
do not care. And "least surprise" may just be
the cute word to camouflage that.

Just a thought... Otherwise I respect your style.



----- Original Message ----
From: Dan Bron <[EMAIL PROTECTED]>
To: Programming forum <[email protected]>
Sent: Saturday, November 25, 2006 12:04:44 PM
Subject: RE: [Jprogramming] zig-zag order


Oleg wrote:

>    ($ [: /:@; [: <@|.`</. i.)@,~ 4

Nice improvement.

> Note: rank of @ vs @:

In this case, the only difference is taste.  The three uses of  @  are atop 
verbs whose relevant valence has infinite rank.

My style is to use  @:  unless I __mean__  @  .  That is, unless  @  would 
produce different results, and I want those results
(e.g.  [EMAIL PROTECTED]  ).  It's a simple rule which sustains the principle 
of least surprise.  Also, in the general case,  @:  is faster
(because it lets primitives see as much data as possible).  The trade off is 
that it's longer and not as pretty (it makes J code
murkier and scanning less fluid).

-Dan

----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm


 
____________________________________________________________________________________
Yahoo! Music Unlimited
Access over 1 million songs.
http://music.yahoo.com/unlimited
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to