On 24 October 2013 02:42, Tony Harminc <t...@harminc.com> wrote:

On 23 October 2013 19:43, Paul Gilmartin <paulgboul...@aim.com> wrote:
> > I have occasionally gotten
> > flamboyant and coded such as:
> >
> >     X = copies( 'gubbins', A==B )  /* instead of:  */
> >
> >     if A==B
> >         then X = 'gubbins'
> >         else X = ''
>
> That's a very APLish thing to do.
>

I would be worried about (when the language permits it)    x =
copies('gubbins', c=a==b)

No doubt a matter of style and experience, but I find if/then/else hard to
follow when reading. Especially when ident does not match the nesting. Once
you're familiar with the idioms, they reduce the amount of reading and
increase what you can oversee on a single screen or page.

Reducing the vocabulary does not make a coded algorithm easier to
understand. I you have no clue about binary search, then following the
if/then/else with your finger may not help you spot an error. Knowing the
language is the least of your concerns.

A popular one we use is this:  return rc * (rc <> 12)
Or this (to assign defaults to missing arguments):
  parse value subword(outf,1,3) subword('BUNDLE VMFPLC A', words(outf)+1)
with outf

Rob (almost Friday)

Reply via email to