4 ms·
http://misko.hevery.com/code-reviewers-guide/ http://misko.hevery.com/code-reviewers-guide/ This guy was a google test-ability engineer. His assertion is that
by hayst4ck 4y ago
http://misko.hevery.com/code-reviewers-guide/ http://misko.hevery.com/code-reviewers-guide/
This guy was a google test-ability engineer. His assertion is that good code (code that is decoupled/easy to replace) is code that it is easy to write unit tests for because all the things that make unit testing hard is bad engineering, like coupling of components or poorly scoped data.
If I summarized 80% of his the value of his work in one sentence it would be "Don't abuse global scope." It is a surprisingly simple restriction that results in orders of magnitude better code. Calling a function inside of a constructor is using that function from the global scope and therefore it is an abuse of global scope. If you mine his website, which is admittedly outdated, there are many many examples of the consequences of code patterns that will hurt later.