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



One thing I just started doing when refactoring Subroutines into Subprocedures - - is when confronted with many subroutines using many global variables, is that due to the time constraints, I do not fiddle with the global variables very much, as this just takes too much time.

Rather, when I determine a "grouping" of similar subroutines ( like several Edit Routines called by a Master Edit Subroutine) is to take all those subservient subroutines and move them into a Master SubProcedure - - so now, that Subprocedure at the bottom of the program contains all the gory Begsr and use of Global Variables and the other unsavory things that Subroutines strap us with.

This helps because:

1. They are now grouped into a higher level grouping, that I can give a long-meaningful name to, so that is what I think of - rather than dealing with dozens of 6 letter abbreviations that are the Subroutines.
This is not a very good abstraction, but it is one part of improving the program in the long run.

2. When Debugging, I can now use STEP-OVER and I do not need to go through all those miniscule steps which are now bundled into a single SubProc.
In the same vein, when I see a loop - any loop - I consider if I can move it into a SubProc - just to save time when I have to crank up the Debugger. ( Beginning to love STEP-OVER ! )

3. Later when I am in the program for other reasons, then I can deal with modifying the global variables.

- John Voris


date: Tue, 8 Jul 2014
from: "D*B" <dieter.bendersubject:
Re: Are subroutines codependent?

"global data and coupling procedures by global data is not bad design! Bad
design is to define data global, which is needed only local "

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

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.