Nick Hodges – As a general rule, developers should limit the scope of variables as much as possible. Keeping the notion of limiting scope in every way possible, from the big things (never, ever, ever use global variables)to the subtle little things a language can do (declare const parameters whenever possible) all can contribute to clean, easy to test code. Limiting scope has all kind of benefits. First, limiting scope of a variable reduces the number of places that a given variable can be modified. The reason we rightfully abhor global variables is there is no telling where ...
Visits by Source
Users who voted for this posting
Jørn E. Angeltveit