From 4696867c25a1de6e8381cf59b7666b8c19ee3668 Mon Sep 17 00:00:00 2001 From: Oleksii Trekhleb Date: Sat, 1 Feb 2020 14:30:54 +0100 Subject: [PATCH] Add more principles. --- README.md | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/README.md b/README.md index 17ca938..d133ce6 100644 --- a/README.md +++ b/README.md @@ -308,6 +308,40 @@ async function someFunction() { } ``` +### 💩 Mess with indentations + +Avoid indentations since they make complex code take up more space in the editor. If you're not filling like avoiding them then just mess with them. + +_Good 👍🏻_ + +```javascript +const fruits = ['apple', + 'orange', 'grape', 'pineapple']; + const toppings = ['syrup', 'cream', + 'jam', + 'chocolate']; +const desserts = []; +fruits.forEach(fruit => { +toppings.forEach(topping => { + desserts.push([ +fruit,topping]); + });}) +``` + +_Bad 👎🏻_ + +```javascript +const fruits = ['apple', 'orange', 'grape', 'pineapple']; +const toppings = ['syrup', 'cream', 'jam', 'chocolate']; +const desserts = []; + +fruits.forEach(fruit => { + toppings.forEach(topping => { + desserts.push([fruit, topping]); + }); +}) +``` + ### 💩 Do not lock your dependencies Update your dependencies on each new installation in uncontrolled way. Why stick to the past, let's use the cutting edge libraries versions.