>I disagree that the second way is more understandable (yep. it's a word in
>English). If the next programmer understands Java (and OO for that matter)
it
>will be just as easily understood as the first method.

IMO, it's better to write :

                catID = rootRs.getString("cat_id");
                categories.addElement(getCategory(catID));

than :

                categories.addElement(getCategory(rootRs.getString("cat_id")));

because while testing your code, you may have to check the value of catID.
With the second example, there is no way to test for the value returned by
getString("cat_id").

So the question is : should you then optimize your code by switching to the
second version.

You shouldn't.

Pierre-Yves

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to