|
1 | 1 | # clean-code-javascript
|
2 | 2 |
|
3 | 3 | ## Table of Contents
|
4 |
| - |
5 |
| -1. [Introduction](#introduction) |
6 |
| -2. [Variables](#variables) |
7 |
| -3. [Functions](#functions) |
8 |
| -4. [Objects and Data Structures](#objects-and-data-structures) |
9 |
| -5. [Classes](#classes) |
10 |
| -6. [SOLID](#solid) |
11 |
| -7. [Testing](#testing) |
12 |
| -8. [Concurrency](#concurrency) |
13 |
| -9. [Error Handling](#error-handling) |
14 |
| -10. [Formatting](#formatting) |
15 |
| -11. [Comments](#comments) |
16 |
| -12. [Translation](#translation) |
| 4 | +- [clean-code-javascript](#clean-code-javascript) |
| 5 | + * [Table of Contents](#table-of-contents) |
| 6 | + * [Introduction](#introduction) |
| 7 | + * [**Variables**](#--variables--) |
| 8 | + + [Use meaningful and pronounceable variable names](#use-meaningful-and-pronounceable-variable-names) |
| 9 | + + [Use the same vocabulary for the same type of variable](#use-the-same-vocabulary-for-the-same-type-of-variable) |
| 10 | + + [Use searchable names](#use-searchable-names) |
| 11 | + + [Use explanatory variables](#use-explanatory-variables) |
| 12 | + + [Avoid Mental Mapping](#avoid-mental-mapping) |
| 13 | + + [Don't add unneeded context](#don-t-add-unneeded-context) |
| 14 | + + [Use default arguments instead of short circuiting or conditionals](#use-default-arguments-instead-of-short-circuiting-or-conditionals) |
| 15 | + * [**Functions**](#--functions--) |
| 16 | + + [Function arguments (2 or fewer ideally)](#function-arguments--2-or-fewer-ideally-) |
| 17 | + + [Functions should do one thing](#functions-should-do-one-thing) |
| 18 | + + [Function names should say what they do](#function-names-should-say-what-they-do) |
| 19 | + + [Functions should only be one level of abstraction](#functions-should-only-be-one-level-of-abstraction) |
| 20 | + + [Remove duplicate code](#remove-duplicate-code) |
| 21 | + + [Set default objects with Object.assign](#set-default-objects-with-objectassign) |
| 22 | + + [Don't use flags as function parameters](#don-t-use-flags-as-function-parameters) |
| 23 | + + [Avoid Side Effects (part 1)](#avoid-side-effects--part-1-) |
| 24 | + + [Avoid Side Effects (part 2)](#avoid-side-effects--part-2-) |
| 25 | + + [Don't write to global functions](#don-t-write-to-global-functions) |
| 26 | + + [Favor functional programming over imperative programming](#favor-functional-programming-over-imperative-programming) |
| 27 | + + [Encapsulate conditionals](#encapsulate-conditionals) |
| 28 | + + [Avoid negative conditionals](#avoid-negative-conditionals) |
| 29 | + + [Avoid conditionals](#avoid-conditionals) |
| 30 | + + [Avoid type-checking (part 1)](#avoid-type-checking--part-1-) |
| 31 | + + [Avoid type-checking (part 2)](#avoid-type-checking--part-2-) |
| 32 | + + [Don't over-optimize](#don-t-over-optimize) |
| 33 | + + [Remove dead code](#remove-dead-code) |
| 34 | + * [**Objects and Data Structures**](#--objects-and-data-structures--) |
| 35 | + + [Use getters and setters](#use-getters-and-setters) |
| 36 | + + [Make objects have private members](#make-objects-have-private-members) |
| 37 | + * [**Classes**](#--classes--) |
| 38 | + + [Prefer ES2015/ES6 classes over ES5 plain functions](#prefer-es2015-es6-classes-over-es5-plain-functions) |
| 39 | + + [Use method chaining](#use-method-chaining) |
| 40 | + + [Prefer composition over inheritance](#prefer-composition-over-inheritance) |
| 41 | + * [**SOLID**](#--solid--) |
| 42 | + + [Single Responsibility Principle (SRP)](#single-responsibility-principle--srp-) |
| 43 | + + [Open/Closed Principle (OCP)](#open-closed-principle--ocp-) |
| 44 | + + [Liskov Substitution Principle (LSP)](#liskov-substitution-principle--lsp-) |
| 45 | + + [Interface Segregation Principle (ISP)](#interface-segregation-principle--isp-) |
| 46 | + + [Dependency Inversion Principle (DIP)](#dependency-inversion-principle--dip-) |
| 47 | + * [**Testing**](#--testing--) |
| 48 | + + [Single concept per test](#single-concept-per-test) |
| 49 | + * [**Concurrency**](#--concurrency--) |
| 50 | + + [Use Promises, not callbacks](#use-promises--not-callbacks) |
| 51 | + + [Async/Await are even cleaner than Promises](#async-await-are-even-cleaner-than-promises) |
| 52 | + * [**Error Handling**](#--error-handling--) |
| 53 | + + [Don't ignore caught errors](#don-t-ignore-caught-errors) |
| 54 | + + [Don't ignore rejected promises](#don-t-ignore-rejected-promises) |
| 55 | + * [**Formatting**](#--formatting--) |
| 56 | + + [Use consistent capitalization](#use-consistent-capitalization) |
| 57 | + + [Function callers and callees should be close](#function-callers-and-callees-should-be-close) |
| 58 | + * [**Comments**](#--comments--) |
| 59 | + + [Only comment things that have business logic complexity.](#only-comment-things-that-have-business-logic-complexity) |
| 60 | + + [Don't leave commented out code in your codebase](#don-t-leave-commented-out-code-in-your-codebase) |
| 61 | + + [Don't have journal comments](#don-t-have-journal-comments) |
| 62 | + + [Avoid positional markers](#avoid-positional-markers) |
| 63 | + * [Translation](#translation) |
17 | 64 |
|
18 | 65 | ## Introduction
|
19 | 66 |
|
|
0 commit comments