avilabiel / clean-code-typescript

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

clean-code-typescript

This repository aims to store some clean code techniques to help anyone that wants to excel their skills on Clean Code. Below there are some techniques described and most of them have examples in Typescript on this repository.

Resources

The techniques below are based on:

  1. Clean Code - Robert C. Martin
  2. Object Calisthenics - William Durand

Techniques

Meaningful variables

Variables names should be meaningful and express clearly what they mean.

Tiny functions

Keep one identation level on your functions. If there are more levels, let's create other functions. With that, we follow Single Responsibility Principle.

Functions as verbs

Functions should be verbs.

Classes as nouns

Classes should be nouns.

Named booleans

When the condition is hard to understand, let's name it!

Simple objects

Keep one idendation level on your objects! If there are more, let's create other objects. With that, we

Descruturing Params

Destruct params to not enforce params positions.

Don't use unnecessary comments

Updated comments rarely exist. Keep comments updated is a hard task to accomplish.

Keep consistency of the codebase

Follow the good standards that your codebase already have.

About


Languages

Language:TypeScript 100.0%