Bob Hall
rjhjr at cox.net
Tue Jul 13 00:28:46 CDT 2004
On Mon, Jul 12, 2004 at 05:38:27PM -0500, Mcgillivray, Donald [ITS] wrote: > To the extent that I can call myself a programmer (not far I promise!) > I'm totally self-taught, so when topics like this come up, I follow them > with an eye toward expanding my knowledge and understanding of the finer > points. That said, I'm not sure I follow the distinction between the > two examples you cite. True, one assigns a specific value directly to > the variable, while the other calls a separate function to do so, but > the choice of one over the other is less a matter of speed versus > flexibility than it is a matter of what's available at runtime to assign > to the variable. If the value is unknown until retrieved via some other > process, there really isn't much choice, is there? Similarly, if the > value IS known and can be reliably coded into the procedure (number of > days in a week, for example), why run some other procedure to retrieve > it? Whether "hard-coded" or dynamic, neither one actually does anything > until the code is run, right? Or am I misunderstanding something in the > concept being illustrated? If you bind a variable early, e.g. lngWibble = 47 then you have to go into the code and change the code if you want to change the value you are binding to lngWibble. If you bind late, e.g. lngWibble = ReadSomeFileAndFetchWibbleValue() then you can change the value assigned to lngWibble by changing data in the file. Any can do this with a text editor and it doesn't require rewriting and recompiling the code. Configuration files all work this way.