-
Notifications
You must be signed in to change notification settings - Fork 51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Minimize use of global variables #244
Comments
Here's another example from the bar chart template:
|
This is only slightly relevant, but I think it would be useful to refactor |
@katiepark haha:
I was literally writing that as your comment came in. |
I noticed that there are a lot of global variables used in the State grid map template.
Use of global variables can make it difficult to reason about control flow in programs and make testing code difficult.
They also make it tempting to use global variables in customizations to the template, even though it's not terribly difficult to pass shared values as function arguments.
At the very least, globals should be limited to the items that come from the upstream spreadsheets such as
DATA
andLABELS
, though this is probably unnecessary as well. Or all global state could be consolidated into a single shared global object.The text was updated successfully, but these errors were encountered: