From ec9a99d33935a9509df234ce7a128f2929ba4711 Mon Sep 17 00:00:00 2001 From: Ilya Kantor Date: Sat, 9 Feb 2019 13:16:02 +0300 Subject: [PATCH] Update article.md --- 1-js/03-code-quality/04-ninja-code/article.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/1-js/03-code-quality/04-ninja-code/article.md b/1-js/03-code-quality/04-ninja-code/article.md index b34baf76..9019242f 100644 --- a/1-js/03-code-quality/04-ninja-code/article.md +++ b/1-js/03-code-quality/04-ninja-code/article.md @@ -83,7 +83,7 @@ While choosing a name try to use the most abstract word. Like `obj`, `data`, `va Give them a try. A young initiate may wonder -- are such names really useful for a ninja? Indeed, they are! - Sure, the variable name still means something. It says what's inside the variable: a string, a number or something else. But when an outsider tries to understand the code, he'll be surprised to see that there's actually no information at all! And will ultimately fail to alter your well-thought code. + Sure, the variable name still means something. It says what's inside the variable: a string, a number or something else. But when an outsider tries to understand the code, they'll be surprised to see that there's actually no information at all! And will ultimately fail to alter your well-thought code. The value type is easy to find out by debugging. But what's the meaning of the variable? Which string/number does it store? @@ -153,7 +153,7 @@ function ninjaFunction(elem) { } ``` -A fellow programmer who wants to work with `elem` in the second half of the function will be surprised... Only during the debugging, after examining the code they will find out that he's working with a clone! +A fellow programmer who wants to work with `elem` in the second half of the function will be surprised... Only during the debugging, after examining the code they will find out that they're working with a clone! Seen in code regularly. Deadly effective even against an experienced ninja. @@ -197,7 +197,7 @@ function render() { A programmer who jumps inside the `render` will probably fail to notice that there's a local `user` shadowing the outer one. -Then he'll try to work with `user` assuming that it's the external variable, the result of `authenticateUser()`... The trap is sprung! Hello, debugger... +Then they'll try to work with `user` assuming that it's the external variable, the result of `authenticateUser()`... The trap is sprung! Hello, debugger... ## Side-effects everywhere!