Re:Confidence Through Feedback, or Why Imposter Syndrome Is ...
by chriswarbo on Friday November 20, 2015 @09:04AM
(#10601164)
Whilst it's probably impossible to write code without understanding anything about scope, you can actually get quite far without understanding lexical scope and closures.
For example, I've worked on a load of JS projects where every function is first-order, named and written at the top level, except for a few clearly redundant anonymous callbacks like `function(x) { return foo(x); }`. Obviously that code has been written without understanding first-class functions, lexical scope, closures, etc. but it worked.
I've also been in the reverse situation in code reviews: where I've made some use of lexical scope in my code, and had to explain what lexical scope and closures are to the other members of the team.
For example, I've worked on a load of JS projects where every function is first-order, named and written at the top level, except for a few clearly redundant anonymous callbacks like `function(x) { return foo(x); }`. Obviously that code has been written without understanding first-class functions, lexical scope, closures, etc. but it worked.
I've also been in the reverse situation in code reviews: where I've made some use of lexical scope in my code, and had to explain what lexical scope and closures are to the other members of the team.