Never, ever use Iterable as a return type
This is a short rant. Please do not use Iterable
as a return type. Its Javadoc states that
Implementing this interface allows an object to be the target of the "foreach" statement.
That's the only purpose of this interface.
Other than that, this interface is almost useless, or at least a PITA to consume. For example, to obtain the size of an Iterable
you'd need to do this:
Read full article from Never, ever use Iterable as a return type
No comments:
Post a Comment