Should variables be stored in local blocks? Ans. The use of local blocks for storing variables is unusual and therefore should be avoided, with only rare exceptions. One of these exceptions would be for debugging purposes, when you might want to declare a local instance of a global variable to test within your function. You also might want to use a local block when you want to make your program more readable in the current context. Sometimes having the variable declared closer to where it is used makes your program more readable. However, well-written programs usually do not have to resort to declaring variables in this manner, and you should avoid using local blocks. - Study24x7
Social learning Network
13 Mar 2023 11:06 AM study24x7 study24x7

Should variables be stored in local blocks? Ans. The use of local blocks for storing variables is unusual and therefore should be avoided, with only rare exceptions. One of these exceptions would be for debugging purposes, when you might want to declare a local instance of a glo...

See more

study24x7
Write a comment
Related Questions
500+   more Questions to answer
Most Related Articles