From f5dc7a3e103700f020ec37e6eb55b58ee916c261 Mon Sep 17 00:00:00 2001 From: Oleksii Trekhleb Date: Wed, 29 Jan 2020 06:25:28 +0100 Subject: [PATCH] Add more principles. --- README.md | 46 +++++++++++++++++++++++++++++++++++++--------- 1 file changed, 37 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index f06ee3f..99e5e43 100644 --- a/README.md +++ b/README.md @@ -150,25 +150,32 @@ try { } ``` -### 💩 Do not lock your dependencies +### 💩 Use global variables extensively -Update your dependencies on each new installation in uncontrolled way. Why stick to the past, let's use the cutting edge libraries versions. +Globalization principle. _Good 👍🏻_ -``` -$ ls -la +```javascript +let x = 5; -package.json +function square() { + x = x ** 2; +} + +square(); // Now x is 25. ``` _Bad 👎🏻_ -``` -$ ls -la +```javascript +let x = 5; -package.json -package-lock.json +function square(num) { + return num ** 2; +} + +x = square(x); // Now x is 25. ``` ### 💩 Triangle principle @@ -214,6 +221,27 @@ async function someFunction() { } ``` +### 💩 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. + +_Good 👍🏻_ + +``` +$ ls -la + +package.json +``` + +_Bad 👎🏻_ + +``` +$ ls -la + +package.json +package-lock.json +``` + ### 💩 Avoid covering your code with tests This is a duplicate and unnecessary amount of work.