in reply to subroutine recurse vs goto LABEL
There are two rules to when you should use recursion (or actually if you can't fullfill these rules don't use recursion)
Base Case: there must be at least one case where recursion is not called.
Winnowing: each call in the recursion should be working on a subset of the data towards the base case.
There are some other auxillary things to think about (memory consumption, namespace clashing, etc) and I remember reading somewhere that all recursive routines could and should be solved iteratively but sometimes recursion is damn fun and it amazes and annoys your coworkers.
So looking at your code, you do have a base class - that read is going to end sometime, right? But, you're really not winnowing the data - your just moving through it sequentially.
-derby
|
|---|