Compute and storage
Generators help in processing collections or streaming of data, without the need to collect all data. They allow incremental processing as well as lazy evaluation, unfortunately. Lazy evaluation is related to functional programming and is beyond the scope of this article. Programming using generators is preferred when compute is cheaper than storage.