JavaScript-Style-Guide

Developing sustainable projects in JavaScript – a style guide

An opinionated list by Ruben Verborgh

1. Code structure

1.1. Use object orientation by default

JavaScript is a multi-paradigm programming language. Without making any judgement about any paradigm, we choose object orientation as the default approach.

Within this paradigm, we make the following decisions.

1.2. Design for substitutability

1.3. Organize code conceptually in packages

2. Coding style

2.1. Consistency

2.2. Defensive programming

2.3. Asynchronicity

3. Testing