DEV Community

Cezary Tomczyk
Cezary Tomczyk

Posted on

Top 10 bad practices in frontend development

Here are the top 10 bad practices in frontend development:

  • Not using version control: Version control is essential for managing code changes and collaborating with other developers. Not using version control can lead to code conflicts and make it difficult to track changes over time.
  • Not optimizing images: Large images can slow down page load times, which can negatively impact the user experience. It's important to optimize images by compressing them and reducing their file size. A good practice is to serve responsive images.
  • Not testing on multiple devices and browsers: Websites should be tested on multiple devices and browsers to ensure that they work correctly for all users. Not testing on multiple devices and browsers can lead to compatibility issues.
  • Not following accessibility guidelines: Websites should be designed with accessibility in mind to ensure that they are usable by people with disabilities. Not following accessibility guidelines can lead to legal issues and prevent some users from accessing your content. Best is to audit website on the client side to get results based on a real user.
  • Not using semantic HTML: Semantic HTML helps search engines understand the content of your website and improves accessibility for users with screen readers. Not using semantic HTML can make it difficult for search engines to understand your site, as the code itself may not precisely describe the purpose of the content.
  • Not optimizing CSS and JavaScript: Large CSS and JavaScript files can slow down page load times, which can negatively impact user experience. It's important to optimize CSS and JavaScript by minifying them and reducing their file size.
  • Not using a CSS preprocessor: CSS preprocessors like Sass and Less can help you write more efficient and maintainable CSS code. Not using a CSS preprocessor can make it difficult to manage large CSS files and make the code less scalable.
  • Not using a task runner or build tool: Task runners like Gulp, Rollup or Webpack can automate repetitive tasks like minifying CSS, JavaScript files and many other tasks that can be automated to keep software development process consistent.
  • Not following coding standards: Following coding standards makes it easier for other developers to read and understand your code. Not following coding standards leads to inconsistency in software development pipeline and can make it difficult for other developers to work with your code.
  • Redundant comments: Comments that explain situations that can't be explained by the code itself are useful. However, commenting on each line of the code or requesting actions in the comments may misguide code readers, as the comments may easily be outdated.

Thoughts on that are very welcome.

Top comments (0)