3 ms·
Of course, I would use a global whenever appropriate. But I would try and limit the number of entry points to that global (for instance by limiting its scope,
by loup-vaillant 9y ago
Of course, I would use a global whenever appropriate. But I would try and limit the number of entry points to that global (for instance by limiting its scope, or putting a big fat comment about how we're supposed to use it), so I don't end up making implicit data dependencies spaghetti.
- jstimpfle 9y agoOne should always avoid unnecessary dependencies. But I don't use special syntax or complicated scope rules to achieve that. This only makes the code more complex. No -- I just don't depend. I don't reference the global where it's not needed. Simple :-)