Phase out global variables
Created by: MichaelSpece
Suggested labels: enhancement
The use of global variables renders the code opaque and harder to modify, and dynare more prone to bugs and harder to debug. All functions potentially depend on the global variables in unknown ways (unless the coder is omniscient). Consequently, modifying how global variables work could break any function, and, moreover, any new function which modifies global variables could break existing functions. For similar reasons, multiple dynare instances cannot be run in the same Matlab instance, complicating parallelization (see e.g. http://www.dynare.org/phpBB3/viewtopic.php?f=1&t=4981, http://www.dynare.org/phpBB3/viewtopic.php?f=1&t=3531&p=8310&hilit=parfor#p8310, and http://www.dynare.org/phpBB3/viewtopic.php?f=1&t=3530&p=8269&hilit=parfor#p8269). Again because of their universal nature, the relationship among the global variables themselves is opaque (see e.g. #503 (closed)).