September 2019
Intermediate to advanced
816 pages
18h 47m
English
The clean code best practices include keeping a small scope for all local variables. This is one of the clean code golden rules that was followed even before the existence of LVTI.
This rule sustains the readability and debugging phase. It can speed up the process of finding bugs and writing fixes. Consider the following example that breaks down this rule:
// Avoid...var stack = new Stack<String>();stack.push("John");stack.push("Martin");stack.push("Anghel");stack.push("Christian");// 50 lines of code that doesn't use stack// John, Martin, Anghel, Christianstack.forEach(...);
So, the preceding code declares a stack with four names, contains 50 lines of code that don't use this stack, and finishes with a loop of ...
Read now
Unlock full access