From 1e4cab06d16a28d97aaf38eab47d8e92d5417f73 Mon Sep 17 00:00:00 2001 From: Heshan Wanigasooriya Date: Fri, 13 May 2022 10:33:16 -0400 Subject: [PATCH 1/2] Update README.md --- README.md | 73 +++++++++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 60 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 631db6e8..3398dabd 100644 --- a/README.md +++ b/README.md @@ -1,19 +1,66 @@ # clean-code-javascript ## Table of Contents - -1. [Introduction](#introduction) -2. [Variables](#variables) -3. [Functions](#functions) -4. [Objects and Data Structures](#objects-and-data-structures) -5. [Classes](#classes) -6. [SOLID](#solid) -7. [Testing](#testing) -8. [Concurrency](#concurrency) -9. [Error Handling](#error-handling) -10. [Formatting](#formatting) -11. [Comments](#comments) -12. [Translation](#translation) +- [clean-code-javascript](#clean-code-javascript) + * [Table of Contents](#table-of-contents) + * [Introduction](#introduction) + * [**Variables**](#--variables--) + + [Use meaningful and pronounceable variable names](#use-meaningful-and-pronounceable-variable-names) + + [Use the same vocabulary for the same type of variable](#use-the-same-vocabulary-for-the-same-type-of-variable) + + [Use searchable names](#use-searchable-names) + + [Use explanatory variables](#use-explanatory-variables) + + [Avoid Mental Mapping](#avoid-mental-mapping) + + [Don't add unneeded context](#don-t-add-unneeded-context) + + [Use default arguments instead of short circuiting or conditionals](#use-default-arguments-instead-of-short-circuiting-or-conditionals) + * [**Functions**](#--functions--) + + [Function arguments (2 or fewer ideally)](#function-arguments--2-or-fewer-ideally-) + + [Functions should do one thing](#functions-should-do-one-thing) + + [Function names should say what they do](#function-names-should-say-what-they-do) + + [Functions should only be one level of abstraction](#functions-should-only-be-one-level-of-abstraction) + + [Remove duplicate code](#remove-duplicate-code) + + [Set default objects with Object.assign](#set-default-objects-with-objectassign) + + [Don't use flags as function parameters](#don-t-use-flags-as-function-parameters) + + [Avoid Side Effects (part 1)](#avoid-side-effects--part-1-) + + [Avoid Side Effects (part 2)](#avoid-side-effects--part-2-) + + [Don't write to global functions](#don-t-write-to-global-functions) + + [Favor functional programming over imperative programming](#favor-functional-programming-over-imperative-programming) + + [Encapsulate conditionals](#encapsulate-conditionals) + + [Avoid negative conditionals](#avoid-negative-conditionals) + + [Avoid conditionals](#avoid-conditionals) + + [Avoid type-checking (part 1)](#avoid-type-checking--part-1-) + + [Avoid type-checking (part 2)](#avoid-type-checking--part-2-) + + [Don't over-optimize](#don-t-over-optimize) + + [Remove dead code](#remove-dead-code) + * [**Objects and Data Structures**](#--objects-and-data-structures--) + + [Use getters and setters](#use-getters-and-setters) + + [Make objects have private members](#make-objects-have-private-members) + * [**Classes**](#--classes--) + + [Prefer ES2015/ES6 classes over ES5 plain functions](#prefer-es2015-es6-classes-over-es5-plain-functions) + + [Use method chaining](#use-method-chaining) + + [Prefer composition over inheritance](#prefer-composition-over-inheritance) + * [**SOLID**](#--solid--) + + [Single Responsibility Principle (SRP)](#single-responsibility-principle--srp-) + + [Open/Closed Principle (OCP)](#open-closed-principle--ocp-) + + [Liskov Substitution Principle (LSP)](#liskov-substitution-principle--lsp-) + + [Interface Segregation Principle (ISP)](#interface-segregation-principle--isp-) + + [Dependency Inversion Principle (DIP)](#dependency-inversion-principle--dip-) + * [**Testing**](#--testing--) + + [Single concept per test](#single-concept-per-test) + * [**Concurrency**](#--concurrency--) + + [Use Promises, not callbacks](#use-promises--not-callbacks) + + [Async/Await are even cleaner than Promises](#async-await-are-even-cleaner-than-promises) + * [**Error Handling**](#--error-handling--) + + [Don't ignore caught errors](#don-t-ignore-caught-errors) + + [Don't ignore rejected promises](#don-t-ignore-rejected-promises) + * [**Formatting**](#--formatting--) + + [Use consistent capitalization](#use-consistent-capitalization) + + [Function callers and callees should be close](#function-callers-and-callees-should-be-close) + * [**Comments**](#--comments--) + + [Only comment things that have business logic complexity.](#only-comment-things-that-have-business-logic-complexity) + + [Don't leave commented out code in your codebase](#don-t-leave-commented-out-code-in-your-codebase) + + [Don't have journal comments](#don-t-have-journal-comments) + + [Avoid positional markers](#avoid-positional-markers) + * [Translation](#translation) ## Introduction From 67089fa7d5205cb3d1266fe718f3d9e2eb59ac28 Mon Sep 17 00:00:00 2001 From: Heshan Wanigasooriya Date: Fri, 13 May 2022 10:33:57 -0400 Subject: [PATCH 2/2] Update README.md --- README.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/README.md b/README.md index 3398dabd..fab958c9 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,6 @@ # clean-code-javascript ## Table of Contents -- [clean-code-javascript](#clean-code-javascript) - * [Table of Contents](#table-of-contents) * [Introduction](#introduction) * [**Variables**](#--variables--) + [Use meaningful and pronounceable variable names](#use-meaningful-and-pronounceable-variable-names)