19606, "vasslitvinov", "Random skipToNth, getNth - needed? good names?", "2022-04-05T20:11:33Z"
Background: today skipToNth(n)
advances or rewinds the stream to the n-th position; getNth(n)
combines that atomically with getting the next element.
Do we want to keep these methods?
getNth
:
- pro: provides an atomic combination
skipToNth
and getNth
:
- con: we want to steer users away from using this often, as it is much slower than
getNext()
If we keep these, what are good names for them?
skipToNth
- rename to one of:
-
advance
? cons: it can also rewind -
reposition
? -
skipTo
?
getNth
- rename to:
-
fetchAdvance
- emphasizes atomicity; should it be 'advanceFetch' ? -
skipFetch
?