× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



I invoke the power of Howard the Duck.

On Thu, Mar 24, 2011 at 2:13 PM, James Lampert <jamesl@xxxxxxxxxxxxxxxxx> wrote:
Michael Ryan wrote:
Of course EVAL and IF are idiomatic to RPG...they're part of the
idiom. The global idiom of RPG has and is changing. That would be like
saying computer is not idiomatic to English because no one said it as
they were sailing over on the Mayflower.

Uh, no. Not quite.

"Mir tut der Kopf weh" is, if I can remember my high school German from
about 32 years ago, a perfectly good way to declare, in German, that one
has a headache. But a literal translation to English, "me does the head
pain," or even Babelfish's "the head pain does to me," although
technically correct (albeit convoluted) English syntax, is profoundly
non-idiomatic. Instead, in English, we say, "I have a headache," or "My
head hurts."

Consider COBOL's syntax for a moment. In COBOL, we might have (and it's
been about 28 years since I last used COBOL):

           SUBTRACT CREDIT FROM TOTAL.
or we might have:
           COMPUTE TOTAL = TOTAL - CREDIT.
but the former is more idiomatic to COBOL, and there is a reason for
that language's syntactic design: COBOL was designed, from the ground
up, to be readable and understandable by non-programmers who hadn't
taken a math course since high school algebra.

EVAL and IF statements are less idiomatic to RPG because they introduce
free-format expressions into a rigid format that had been designed to
make sense to users of plugboard-programmable unit record machines (like
the proverbial mailroom kid who taught himself how to wire plugboards).
"/free" takes us even further away, because it switches to a completely
foreign syntax (kind-of, sort-of, but-not-quite PL/I syntax).

(It seems to me that it would have been far more productive to provide a
full ANSI PL/I compiler in the ILE suite, than to graft something that
looks vaguely like PL/I onto RPG. I'd have probably been one of the
people who "lined up at the truck" for that one.)

It's the same reason why I refuse to call QuickBASIC and its derivatives
BASIC. They're not dialects of BASIC; they're dialects of a language
(QBASIC) that's *derived* from BASIC. BASIC has mandatory line numbers,
and uses those line numbers as statement labels. QBASIC doesn't have
mandatory line numbers, and statement labels can be either numbers, or
any valid identifier followed by a colon.

--
JHHL
--
This is the RPG programming on the IBM i / System i (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.