COBOL is a 3GL. RPG is closer to a 4GL ... perhaps a "3 1/2 GL"...
especially when used with the cycle, as originally intended, for
producing reports. With the cycle, lots of stuff is done for you
automatically, so you only have to specify the I-specs (what the input
looks like), the O-specs (what you want the output report to look like),
and perhaps some Calc-specs to do any special computation for each
record. It follows the I-P-O (Input-Process-Output) model.
But, for some reason, on the System/38 and early AS/400, many RPG III or
RPG/400 programmers religiously avoided the cycle, perhaps due to
perceived poor performance on early underpowered IMPI machines, or
perhaps just because they wanted to be "in control" of exactly what
their program was doing. In any case, I recall many times seeing RPG
programs written using "full procedural" style, but when you examine the
code, what you find was that the programmer had "re-invented the wheel"
and "hand-coded" the cycle in RPG. =-O This approach reduces RPG to a
3GL, "throwing out the baby with the bath water" ... IMHO.
If you look at how display files work, especially with subfiles, with
indicators, etc., this is also very "non-procedural" in nature. From
the point of view of the programmer, you just write some records to the
subfile, then you write the subfile control record, and the whole
subfile screen is displayed, and, depending on how you coded your DDS,
the system takes care of all the paging (roll up and roll down), etc.
for you. This is one aspect of OS/400 applications development that is
often hard to grasp for typical 3GL programmers coming from other
platforms, I think in large part because IBM failed to adequately
explain that "display files are declarative (non-proedural) in nature."
This is also why it is difficult to create a web (browser) interface
that exactly mimics all of the built-in behaviors of display files.
With ILE RPG IV, especially /free form, it is less of a 4GL and more of
a 3GL than the old RPG, though you can still use the cycle and some
other features, (like "matched records", etc.). The number of lines of
code to do any given task in RPG vs. COBOL will usually favor RPG,
because COBOL is much more verbose.
Mark
> On 4/11/2013 9:13 AM, Michael Ryan wrote:
COBOL is a fine language. RPG is a fine language. There are nuances, and
certainly syntax differences, but they're about the same from a programmer
perspective (IMO). I haven't written COBOL in a number of years, but I can
remember writing RPG all day and COBOL at an extra gig at night. I was
equally productive I think.
As an Amazon Associate we earn from qualifying purchases.