Independent Consultant — Author, EJB 3 in Action — Expert Group Member, Java EE 6 and EJB 3.1
Originally posted by John Smith:
The confusion stems from the fact that on one hand, most experts would agree that local variables should be declared and initialized right before they are used,
Independent Consultant — Author, EJB 3 in Action — Expert Group Member, Java EE 6 and EJB 3.1
Originally posted by John Smith:
[b]The program source is much more readable if the local variables are declared and initialized immediately before their first use.
Originally posted by John Smith:
[b]
Additionally, you are reducing the scope of that variable and thereby the risk of it misused in any form.
Independent Consultant — Author, EJB 3 in Action — Expert Group Member, Java EE 6 and EJB 3.1