|
I think that static storage is probably the root of the subroutine vs. procedure "conflict." A small program, a simple report or something that does one thing, is going to have mostly global variables. You can create service programs or modules to hide globals from the main program, but there's always the question of when do you see the benefit. There's a critical mass where the extra effort to hide data is worth it. The trick is determining what it is. I prefer using procedures. I was trained in Pascal and C. Global variables were grounds for a slap on the hand unless they were needed for a type definition or something else the entire program needed. I was delighted to see procedures and automatic variables added to RPG. It's made my life easier and increased my job security--job security through obscurity. <g> In 1999 or so I did a little bit of subcontracting for a friend of mine and one of the programs used procedures to do date arithmetic. The procedures converted numeric dates to date dates and returned the result. Some time after the program was installed the Y2K consultants came to my friend asking "What the @#$@$ is this?" > -----Original Message----- > From: rpg400-l-bounces@xxxxxxxxxxxx > [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Alan Campin > Sent: Friday, June 24, 2005 11:24 AM > To: rpg400-l@xxxxxxxxxxxx > Subject: RE: Assembly programmers do it a byte at a time > > I agree this whole thing gets to be a religious issue. > Shouldn't be but it is. > > I think one issue that has only been touched on with using > subroutines vs. procedures and that is static storage. > > In writing an RPG IV program, static storage should be > reduced to the absolute minimum that you need. One of the > primary values of using subprocedure is that you have local > variables. Unless you are using subroutines inside > procedures, you end up with everything being global and > everything static. > >>>>>>>>>>>>>>>>>>>>>> Snip <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< ***************************** NOTICE: All e-mail sent to or from this e-mail address will be received or otherwise recorded by The Sharper Image corporate e-mail system and is subject to archival, monitoring, and review by and/or disclosure to Sharper Image security and other management. This message is intended only for the use of the addressee and may contain information that is privileged and confidential. The contents of this message may contain personal views which are not the views of The Sharper Image. If you are not the intended recipient, dissemination of this communication is prohibited. *****************************
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.