3 ms·
They did: > An iterator could query a database, for example—including the unfortunate possibility that it might alter data, or that iterating through it twice
by hddqsb 4y ago
They did:
> An iterator could query a database, for example—including the unfortunate possibility that it might alter data, or that iterating through it twice might yield completely different results! Some tools (like ReSharper) will warn you against multiple enumeration for this reason.
- sdfhdhjdw3 4y agoOh I saw that. I was expecting that they were gonna discuss stateful iterators more generally. Database iterators are just a tiny subset of stateful iterators. I think discussing the latter more generally would have been more useful than a one-liner about databases.