• Subject: Re: Subprocedure questions
  • From: "Buck Calabro" <calabro@xxxxxxxxxxxxxx>
  • Date: Sun, 23 Jan 2000 15:01:44 -0500

Scott wrote:
>Do you use subroutines within a subprocedure???
>
>Do you think it is a good idea to mix subroutines into a
>nomain module???
 
I would argue that BEGSR/ENDSR is dead now that we have prototyped procedure support.
 
Subprocedures at least give the programmer a hint about how to decompose the routines properly (explicitly defined parameters.)  In a subroutine there's no mental brake advising you to "Stop!  Don't add that new function in there!"  How many times have we seen a GETCRD BEGSR that "gets credit rating" and as long as the subr did a CHAIN to CUSMAS, why not add the code to update the A/R balance, and as long as we're hitting the A/R balance, why not add code to modify the credit rating?  All too soon, there's a mess - it's all mainline code with EXSR substituted for GOTO.
 
There's no guarantee that your programmers will refuse to use global data in a procedure, but I would argue that the new construct will encourage better programming more than the old one will.
 
Buck Calabro
 

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2026 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.