× 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.



There is nothing wrong with using subroutines in an RPG prgram. Procedures
have their place, but to willy-nilly replace subroutines with procedures is
just plain silly.

Global variables are not neccesarily a bad thing. And, for that matter,
neither is GOTO. Now, I do try to eliminate the GOTOs in programs I'm
maintaining, but, as I like to say, "Si fractum non sit, noli id reficere"
(if it ain't broke, don't fix it).


On 8/10/07, Steve Richter <stephenrichter@xxxxxxxxx> wrote:

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.

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.