|
A good system/program design should have high cohesion and low coupling.
IMO, this is basically impossible when using RPGII, RPGIII, or RPG/400,
since all variables are global - unless you turn the subroutines into
called
subprograms.
BTW, when I was learning RPGIII on the System/38 in 1983, IBM was
telling us
(for performance reasons) to NOT use subroutines, instead to use all
in-line
code...
- sjl
Dennis wrote:
I suspect (hope) that Scott was referring to new development or new
functionality here. Certainly, if a new "function" is needed in a
program,
go after the procedure approach instead of subroutines. But I would
caution
that the CONVERSION from subroutines to procedures cannot always be
taken
lightly, especially when you start to use some of the key advantages
of
procedures, like localized data. Too many times I have seen
subroutines
that perform some function, and while they're there they'll
inconspicuously
set some esoteric variable (often with a great name like @ or $ or
some
such
- say the result of a %LOOKUP), and the rest of the program is
supposed to
understand that @ has been set in subroutine XYZ. (I don't condone
this
sort of weak association, but we have to recognize that it exists.)
Now
if
you take XYZ and convert it to a procedure, and unwittingly make @ a
local
variable, the program stops working. If a lot of maintenance has
been
done,
it may take quite a bit of debugging to figure out what has gone
wrong,
especially if you also took this opportunity to give @ a better name.
But as Scott said, the result is definitely worth while, and what you
learn
will benefit YOU as much as or more than it will benefit someone else.
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 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.