General Programming

Rule1:Minimize the scope of local variables


keeping a variable out of block which is used only in block, exposes it to other code also . So as a thum rule use variable as and when required.
Make a method per activity to avoid mixing of variables of different activities.
As a point to note: for loops are better than while because all vaiables are declared and used in shortest possible scope,so less chances of error.

Published by

Unknown's avatar

sevanand yadav

software engineer working as web developer having specialization in spring MVC with mysql,hibernate

Leave a comment