??? 02/26/07 09:50 Read: times |
#133695 - an example, please Responding to: ???'s previous message |
Andy Neil said:
David Gal said:
public This_Entire_File Generally, this would be a bad idea. One of the ideas behind Modular Programming is that each module only "publishes" (or "exposes") a certain set of functions and/or data that will be needed by other modules. Other functions and/or data are "private" to the module, and of no concern to the rest of the program. Doing this helps reduce the risk of other parts of the program fiddling with things that it shouldn't and, thus, messing things up. Can you please give us a relevant negative example? Andy, I don't think what you say is quite true. Unless you have a memory management which _effectively_ disables other modules from fiddling with "hidden" data = a hardware which you don't have in '51, there is no reason for hiding the symbols (other than you don't want to disclose them not to leak out information the internal whereabouts, as in closed source software). The only thing gained by hiding the internal symbols might be the decreased risk of symbols collision (redefinition), but that's resolved as an error when compiling/assembling, isn't it... This is not to say that is should be a common practice to expose everything. I just want to say, that there is no "one size fits all" in engineering - well, basically, you said the same above, isn't it... JW |