JavaScript Development Best Practices

JavaScript Development Best Practices. This post highlights the critical topics which any developer/team must know about and follow religiously to ensure that the end product (like website) is optimized from various aspects like performance, search engine optimization, user friendliness and many more. While this post abstracts the key topics, the subsequent posts will help a learner to explore the details and understand each topic in details.

Keeping different type of audience (front end developers, back end developers, devops team members, infrastructure) in view, the topics have been grouped in to different categories when it comes to development using JavaScript i.e. Front End Development ( React, Angular etc.), Back End Development (primarily using NodeJs etc.), DevOps ( automated CI/CD) and infrastructure provisioning.

JavaScript Development Best Practices

Please note that while this series of posts has considered JavaScript as base for examples and code snippets wherever required, whoever, these best practices hold true for every programming language and front end.

Front End Side

  1. Lazy loading – How to lazy load images, javascript or css of front end pages ( explained in detail in the post titled “Front End – Planning and Building “a performance driven and SEO friendly website”” )
  2. Image sizing and resolution – How an appropriate image sizing and resolution strategy can improve performance
  3. How to handle and render CSS
  4. Importance of using separate style sheets / scripts for mobile/ desktop
  5. Third party scripts etc.
  6. Relevance of DOM size
  7. How limiting the number of records from back end can help faster page load
  8. Using appropriate request headers while calling RESTful APIs etc.

Back End side

  1. Limiting the number of records sent to front end
  2. Appropriate API response headers

Deployment

  1. Use appropriate CDN ( Content Delivery Network)
  2. Manual/ Automated deployment
  3. Use a load balancer to evenly distribute your load
  4. The benefits of caching and how to enable it
  5. How compression can help

There has been a developer’s thought process behind the above mentioned topics. However, if you feel that there is any topic need to be covered, please feel free to write your views in the comments section below. We will come try to come up with a detailed post on the requested topic. Also, please keep us motivated by sharing your feedback in terms of any improvement required in this/future posts OR how do you like this post.

We hope to see you in the future detailed posts.

Leave a Reply

Your email address will not be published. Required fields are marked *