Skip to content
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

Scoping and frontend code #38

Open
maxgerber opened this issue Apr 13, 2018 · 0 comments
Open

Scoping and frontend code #38

maxgerber opened this issue Apr 13, 2018 · 0 comments
Labels

Comments

@maxgerber
Copy link

So, although I think the frontend code is pretty solid, I'd like to make a suggestion about where to ideally place your variables. At the moment, they're just hanging out in the global namespace. In future if people were to add to this code, or add extra JS files for instance, you might find that the variables conflict with eachother. Ideally, variables should be scoped to within the function they're being used in to avoid this happening. It also makes your code easier to read by being more modular - as you can see where and how things are being used, and take things in and out of your code as you see fit.

@Parissai Parissai added the dom label Apr 13, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants