Literate style, making code more readable or going overboard?

"aglet_sesamoid" <[email protected]> Wed, 10 Feb 2010 01:21:36 -0000
Newsgroups gmane.comp.programming.refactoring
Message-ID <[email protected]>
Consider this snippet of java code:

	...
	ArrayList adminUsers = getUsersWithAdminRights( allUsers );
	if ((adminUsers != null) && (adminUsers.size() > 0)) {
	    ....
	}
        ...
       
Does anyone think that this refactoring to a more literate style makes the code easier to read and understand or is it overkill?

        ...
	ArrayList adminUsers = getUsersWithAdminRights( all Users );
	if (thereAreAny(adminUsers) {
	    ....
	}
	...

private boolean thereAreAny(ArrayList list) {
	if (list == null)
	    return false;
	else
 	    return (list.size() > 0)
}



------------------------------------

Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/refactoring/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/refactoring/join
    (Yahoo! ID required)

<*> To change settings via email:
    [email protected] 
    [email protected]

<*> To unsubscribe from this group, send an email to:
    [email protected]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/