|
I get asked this question all the time by students on my ILE courses. My take on this is that (static) procedure calls do _not_ replace (dynamic) program calls - they _complement_ them. The Dynamic Call (CALL and CALLP/EXTPGM) we've used since the S/38 is in fact a WONDERFUL facility. The late bind provides simplicity and flexibility - with a relatively small performance overhead. So, program calls are A Good Thing - just as valuable as they ever have been. On the other hand, Subprocedures provide a much better alternative to Subroutines. Many of the advantages have already been highlighted, (local variables, parameter passing, automatic storage allocation + recursion, more rigorous call interface, expression call, etc.). To my mind, the big advantage of Subprocedures is the ability to "share" code, (through a Service Program). A Subroutine can be shared (proliferated) through the use of /COPY - but results in a significant maintenance burden. In contrast, a Subprocedure can be packaged into Service Programs and shared in a similar manner to a program object. Service Programs act as a "function repository" - a means of building and sharing your own built-in functions without the proliferation problems of /COPY. Now, if Subroutines (and /COPY) are _not_ used in an organisation, the argument for the modularity/reuse which ILE supports becomes a little more difficult. Hope this helps. Brian Parkins
As an Amazon Associate we earn from qualifying purchases.
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.