|
|
|
|
|
by Silhouette
4083 days ago
|
|
Thus, if you have a program that has an immutable global constant it is likely in the same situation. I don't accept your premise. Firstly, constants are used for all kinds of things, from hard mathematical data as in your example to configuring connectivity with external services via particular database details or URLs. Secondly, while some programs really do only have one main purpose and so some of the background/context data really is almost globally applicable, this is certainly not always the case. In particular, the larger a software system becomes, the less likely this is to be true. How do you ever change that value in any way without retesting everything to see what the effect was? If the value doesn't have global scope, you don't have to retest everything, only parts of the system that can be affected by the change. |
|