Globals In 4gl
Posted in 1998
The subject of "global" and "modular" data definitions being used in Informix 4gl code came up the other day. The system I am currently working on uses globals as the defacto standard to pass data from module to module / program to program. Most of the 4gi programs use 15 to 20 complete global record definitions (DEFINE g_record LIKE record.*) and a plethora of modular variables for lot's of different things. The use of variables with modular modular scope was also being discussed. Their use in this particular system is worse than the use of abuse of "globals" in the system. All of my experience prior to this contract has lead me to believe that the fewer globals used the better. I felt that descrete functions without global impact was the best design methodology. I pretty much have take this as gospel and never strayed from the "true" path of functions with parameters passed in and results returned. But other than "I've always done it that way" I don't have many specific arguments against using massive global files. I think that arrays most certainly need to be global in scope and certain variables are okay for modular scope (especially if these variables gain dramatic performance increases in code) Of course I was slapped down pretty hard by the employees that created this system and was told I didn't know what I was talking about. Any thoughts, one way or the other would be greatly appreciated. Thanks.... John Leipold Access Data Consulting Corp.