From 2eba5ff4562069ed01387a3d910a471843e1ebed Mon Sep 17 00:00:00 2001 From: Jiajun Chen Date: Thu, 27 Feb 2020 14:16:56 +0800 Subject: [PATCH] feat: add flag boolean (#8) --- README.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/README.md b/README.md index 6079a00..269b504 100644 --- a/README.md +++ b/README.md @@ -366,6 +366,23 @@ package.json package-lock.json ``` +### 💩 Always name your boolean value 'flag' + +Leave the space for your colleagues to think what the boolean value means. + +_Good 👍🏻_ + +```javascript +let flag = true +``` + +_Bad 👎🏻_ + +```javascript +let isDone = false +let isEmpty = false +``` + ### 💩 Long-read functions are better than short ones. Don't divide a program logic into readable pieces. What if your IDE's search brakes and you will not be able to find the necessary file or function?