amentetteh / to-do-list-app

A basic Todo list web application. It allows you to do a simple CRUD operations on Tasks. Built with vanilla Javascript, HTML5 and CSS3.
MIT License
3 stars 0 forks source link

JavaScript best practices - JavaScript in the browser #8

Open amentetteh opened 2 years ago

amentetteh commented 2 years ago
  1. Do not commit console.log to your repo. It’s ugly, it kills performance and it can make confidential data be visible to anyone using the browser tools to look at your website. No issue
  2. Do not use window.alert() or window.confirm(). It’s ugly, impossible to style, it stops code execution and displays differently on different browsers. Use custom modal instead. No issue
  3. Keep the number of changes/updates to the DOM as low as possible, they are very expensive for the browser. No issue
  4. Keep the application logic separated from DOM manipulation tasks. No issue
  5. Do not use document.write or eval No issue
  6. Add node_modules dir to your .gitignore file as all those files are not needed in your repo (each team member will install all packages thanks to your package.json file). No issue
  7. Do not commit old pieces of code as inline comments. They will make your project look messy. If you need to review a previous version of your code, you can always use git history. No issue