Say I have some program-wide information, like the root directory of the program or the language selected, that I would like the user to be able to change. How should I best go about storing this information in a form easily accessible at any time for any part of the program?
I was thinking of using global variables stored inside an individual file that could be included by other files that need the information. This way, I would just need to change the value of that global variable and the whole program could access the new value as it did before. However, I am afraid that using such global variables would be bad practice. What are your thoughts on this?
(Also, I thought that this would be language-agnostic, but if there are different best ways of accomplishing this in different languages, I would like to hear about that as well)