1. Re: Ltext / Ctext + new questions
- Posted by Derek Parnell <ddparnell at bigpond.com> Sep 20, 2001
- 357 views
Your correct Michael, it really is a matter of personal philosophy. I prefer explicitly nominating the global symbols that must be global, rather than calling everything global on the off chance that one day they might be needed as global. Also, file-level variables being modified by subroutines has nothing to do with OOP. It is still bad programming practice (IMHO) in OOP programs too. ----- Original Message ----- From: <Sabal.Mike at notations.com> To: "EUforum" <EUforum at topica.com> Subject: Re: Ltext / Ctext + new questions I disagree slightly with this comment. The use of global for variables created at the top of a program, even though it has no effect on scope, tells me that that particular variable set serves a 'master data set' purpose and will be 'rudely' modified by subroutines. It used to be considered bad programming practice to modify file-level variables without passing them into and out of subroutines. But OOP has changed that convention. <voice of experience>It's also good practice when doing modular programming, because you may suddenly decide that a stand-alone program is now going to be included as part of a larger set; and then you have to go back and find all those file-level variables that the parent program now needs access to....</voice> Call this rant a flashback from Pascal days -- and 3rd revisions . Michael J. Sabal >>> ddparnell at bigpond.com 09/20/01 04:36PM >>> The use of Global in code that is never included is a waste of effort because it does nothing. You only need Global if you expect to have another program include your file and you what that other program to "see" the constant/variable/routine.