Re: Function Numbering
Posted in 1995
> > Yes, we do use numbering functions. I think it makes it easier to do > maintenance of the code, it's easier to find the functions. > We set a code for each sub-system and then we number every program that > belongs to that sub-system and also label it to know if the program > basically does a Query, Data entry, Report, Updates, Procedures or > functions, Main program, Globals, etc. > So if the Sub-system "Banks" is coded as "BA", a program that mainly > does Query the database could be called "baq01.4gl" (we really use > "baq01.4gx" but that's another question) > And a function inside that module would be : baq01100_Show_Address() > > Regards, I think that is great if it works for you. However, I see no difference between naming a function baq01100_Show_Address() and Query_Show_Address() Except that the former indicates a strict positioning within a hierarchy while the latter does not (i.e. it is modular). What happens when you have a sub-system called Gminski which needs to do the same work? Are you going to use baq01100_Show_Address()? Then you've broken an implied rule. Are you going to copy the function to gmq21100_Show_Address()? Then you've just duplicated code which leads to higher maintenance cost. My personal perference is to have sub-system prefixes for sub-system specific code, and general prefixes for generic code: arch_get_schema() vs get_tmp_filename() Of course now everybody's going to read my code and say, "but jack, when did you start doing that?" cheers j. _____________________________________________________________________________ Jack Parker - Hewlett Packard, BSMC Boise, Idaho, USA jparker@hpbs3645.boi.hp.com _____________________________________________________________________________ "A thing is bigger for being shared" - Gaelic _____________________________________________________________________________ Any opinions expressed herein are my own and not those of my employers. _____________________________________________________________________________