# Generators: Iterators the Modern Way

A hand-written iterator is a bookmark and a page of bookkeeping; a generator writes the same iterator as an ordinary loop that hands out each item with yield, pausing until the next one is asked for, so stops can even be fetched from a server only when they're needed.

![Cheat sheet: Generators: Iterators the Modern Way](https://fsdtrainingmedia.blob.core.windows.net/public/images/2026/11/b8422403e1c243f389332f22357ad2a9.webp)

- Category: Data Structures
- Level: Journeyman
- Tags: c-sharp, Generator, Generator Function, Iterator Pattern, JavaScript, OOP, python, Yield Return
- Author: Gregor Dzierzon
- Updated: November 17, 2026

Source: https://www.ask-codey.com/cheat-sheets/dp-generators-cheat-sheet
