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



Hi Steve

<snip>
the goto is seen by everyone as bad practice. but the
subroutine is just as bad.
</snip>

Isn't that a bit of a generalisation? I don't see the use of GOTO as being
bad practice if a) there's no better alternative to using it, and b) it's
used intelligently.

When I was first learning to program in the early 80's I was taught by one
COBOL lecturer that GOTO was a "dirty" word and shouldn't be used. Indeed,
he knocked marks off coursework for each GOTO statement he found in a
program. Then, on my degree course we were taught the Jackson Structured
Programming methodology and had to "hail" the Godly GOTO. Conversely that
lecturer knocked marks off coursework if the GOTO wasn't used.

These days I don't really have a need to use GOTO because I can control the
program flow nicely using DO's, SELECTS, IF's, etc, however in CL programs I
will use GOTO statements for program restart processing, for example. Is
that bad practice?

Similarly, I have to disagree about the use of subroutines being bad
practice. I understand that there are a lot of benefits involved with
sub-procedures, but there are plenty of times when program modularisation is
made a lot easier and simpler using the good old subroutine. In a typical
program I have a "Screen1" subroutine which calls a "ChkScreen1" subroutine,
which calls a "ClrMsgQ" subroutine, I then have "Screen2" subroutines,
"ProcessFiles" subroutines, and so on. The programs easy to understand even
though I haven't used sub-procedures.

Regards

Jonathan




As an Amazon Associate we earn from qualifying purchases.

This thread ...

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.