JavaScript best practices : DRY, KISS, YAGNI
Opened this issue · 0 comments
aceDavon commented
Personal review ✍️
I have gone through my code base and found the following issues:
Action.js
-
todo-list/src/Actions/actions.js
Lines 13 to 37 in 2abe6ff
- There were many repetitions of the local storage instance, I could define the variable globally and call it at the points I needed it.
Controller.js
-
todo-list/src/Controller/controller.js
Lines 12 to 63 in 2abe6ff
- Redefined a global variable multiple times for the same purpose, I should remove the local declarations and call the global declaration at the points I need them since I don't get to mutate the value of the variable at any point.
These issues can be said to make the code not DRY, and have lots of variables I do not need. They also make the code base quite not simple as the redeclared variable can become so hard to keep track of.