https://github.com/elierotenberg/coding-styles/blob/master/es6.md

Important:

Các quy ước đặt tên biến

Các note để giúp code bạn trông xịn hơn

SOLID Principles

Mục đích chính của việc tái cấu trúc là giải quyết debt technical. Nó biến một mớ hỗn độn thành clean code and simple design. Nice! Nhưng clean code là gì? Dưới đây là một số tính năng của nó:

Trích dẫn từ:

Clean code

Clean code is obvious for other programmers.

Mã sạch là điều hiển nhiên đối với các lập trình viên khác.

And I’m not talking about super-sophisticated algorithms. Poor variable naming, bloated classes and methods, magic numbers -you name it- all of that makes code sloppy and difficult to grasp.

Tôi không nói về những algorithms phức tạp.

Tôi đang nói về cách đặt tên biến kém, các lớp và phương thức cồng kềnh, những con số kỳ diệu - bạn đặt tên cho nó - tất cả những điều đó làm cho mã trở nên cẩu thả và khó nắm bắt.

Clean code doesn’t contain duplication.

Each time you have to make a change in a duplicate code, you have to remember to make the same change to every instance. This increases the cognitive load and slows down the progress.

Clean code contains a minimal number of classes and other moving parts.

Less code is less stuff to keep in your head. Less code is less maintenance. Less code is fewer bugs. Code is a liability, keep it short and simple.

Clean code passes all tests.

You know your code is dirty when only 95% of your tests passed. You know you’re screwed when your test coverage is 0%.

Clean code is easier and cheaper to maintain!