Node.js Coding Style Guidelines

Make your code readable to others

Tarun Gupta
The Startup

--

Software developers are like lone wolves who prefer to work as individuals rather than in a group. I too come in that category. This can sometimes create problems when the need to work in groups arises in a project.

There are both pros and cons involved when working in groups. On the plus side, there are more insights available to a problem which can help get to a better solution, but at the same time there can be collaboration issues when one developer has to go through another developer’s code to debug or review it.

Each individual has his/her own way of writing code and more often than not, there is a high degree of variation among a group of developers. To avoid such problems when working in a team, most of the programming language communities follow standard coding guidelines. By following these guidelines every developer can write code in a specific way that is known to their teammates. This practice can help teams save time reading the code written by other members.

This article is a guide for writing consistent and aesthetically pleasing Node.js code. It is inspired by what is popular within the community, and also features some personal opinions.

Formatting

  • 4 spaces for indentation

--

--

Tarun Gupta
The Startup

A simple fellow writing stories, sharing experiences, sharing his perspective, trying to do his share of humanity.