Today, I am going to present 5 recommendations to produce clean code about variables in JavaScript.
They are principles endorsed by "Clean Code" book authors and adapted for JavaScript. Following them will make your code readable, reusable, and refactorable.
Many developers aren't committed to these principles, making a no-maintainable code.
Following these 5 JavaScript principles, you will make an excellent clean code.
Here they are:
- Use searchable names
- Avoid Mental Mapping
- Use explanatory variables
- Only add the necessary context
- Use pronounceable and meaningful variable names
Use searchable names
Avoid Mental Mapping
Use explanatory variables
Only add the necessary context
Use pronounceable and meaningful variable names
Conclusion
As a front-end developer, you will produce much JavaScript code over time.
It is crucial to make clean code to achieve maintainable code. Taking these types of principles into account will make you level up as a developer.
Here, I share a helpful resource to make clean code in JavaScript. I strongly recommend it:
https://github.com/ryanmcdermott/clean-code-javascript
I hope you enjoyed the article.
If you have any questions, feel free to contact me on LinkedIn, Edi Rodriguez, or leave a comment in the post.
See you in the next post.
Have a great day!
Great content 👍
Basic of fundamentals but great tip. Thanks