I agree with your definition of how sub procs helped your situation and that
is the same approach that I took. That still doesn't address your original
comment of putting sub routines with the likes of GOTO's, but if your
re-definition below serves as a sort of retract to say sub routines can
SOMETIMES be beneficial then I will just drop my challenge.
Aaron Bartell
http://mowyourlawn.com
-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx]
On Behalf Of Steve Richter
Sent: Friday, August 10, 2007 10:33 AM
To: RPG programming on the AS400 / iSeries
Subject: Re: Todays WTF
On 8/10/07, albartell <albartell@xxxxxxxxx> wrote:
the goto is seen by everyone as bad practice. but the subroutine is
just
as bad.
Oh c'mon Steve, why did you go and make a comment like that?
Subroutines
are VERY useful in modularizing code internal to a program. Just
because you can't have local variables doesn't put it into the same
bucket as GOTO's.
I had to work on legacy cobol and rpg code last year and it was a time
killing process. the cobol was impossible with all of its redefines
of the data. But the RPG was very hard to work with also. the rpg I
got a handle on by reworking the subroutines as procedures and eliminating
all the global effects of the routines. For me, complexity is just an
accumulation of details and indirection. Simply looking at a procedure and
being able to tell that a variable is passed as input from the caller is one
level of indirection less than an RPG subroutine.
-Steve
--
This is the RPG programming on the AS400 / iSeries (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.