Re: avoiding huge globals files
Posted in 1996
Rudy Fernandes wrote: > > Great! I was looking for a discussion on globals with somebody who actually > advocates them (rather than use them by accident), and it looks like I've > got one. > A great presentation. I'm still smiles over that Mailman analogy... Seriously, you've given a good weight to your arguments. I think for large amounts of code your approach makes very good sense. For small projects I would probably defer to GLOBALs only because of the kinds of relatively small applications I've had to work with. GLOBALs can easily get out of hand as you state. But why not use both? A good combination of the two can work and should be attempted, to optimize your programs. Large projects that are done right live and die by libraries, and your advice is well taken, for <any> language. I would be willing to bet most of the MRP software out there worth anything mirrors your comments. The only problem I've seen regarding libraries with 4GL, and localized parameters are the increasing executable sizes I've seen over the years as 4GL has "progressed". True, 4.1 is a pretty good release of 4GL, and the executable size is relatively small compared to 6.0x. However, I would greatly encourage anyone using the later releases of 4GL to not only use libraries, and Make, but to also create libraries that do not contain 4GL that creates more bloat. You might consider writing your libraries in C rather than 4GL to give the app even more optimization. I'm not a compiler-writer, but using 4GL functions in libraries (i.e. Fourgen) has got to be asking for trouble--or more memory. Create this program: MAIN DISPLAY "Hello World" END MAIN and see how big the executable is on your system...especially 6.02 or later. There's a lot of something extra in that excutable that I know just ain't needed. Even using "c4gl -s -O myprog.4gl -o myprog.4ge" will only strip out the C-debug statements--there's still a lot of crap left over. And some systems can't use the -O option without problems. So, optimize your code or buy more memory and disks... :-) -- Tim Schaefer \\\\|// tschaefe@mindspring.com (6 6) ------------------------oOOo---( )---o00o--------- Liberty: http://www.lp.org Informix: http://www.iiug.org --------------------------------------------------