Raul Miller <[email protected]> wrote:
> > One problem with APL (that also exists in J) is the temptation to write
> > extremely long "one-liners" that encompass the entire solution to a
> > problem within a single line of code.
>
> This is not unique to J and APL.  I have seen analogous cases in other
> languages (for example: C).
>
> The difference is that this kind of thing can be harder to recognize
> in C -- if you understand a clause you might mistakenly think you
> could understand the sentence, even when that sentence is hundreds of
> lines long and does stuff that you have not even thought to look for.

I once saw a program in B (precursor to C) where the author did exactly
this: every single function consisted of a single return statement, one
of which was several hundred lines long. However, this is much easier to
do in languages like APL and J where most language features can be
accessed without using control structures.

In languages like C, it is impossible to use expression statements to
perform loops, or to use conditionals that mix functions returning void
and other types, so such constructs require the use of multiple statements.

-- Mark D. Niemiec <[email protected]>
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to