Skip to main content

Posts

Showing posts with the label iterators-in-c#

Iterators in c# - a deep dive

CodeProject This article explains the in-depth analysis of how the c sharp yield keyword works under the hood. If you don't have any idea about yield keyword or never used it before, check out my post on Iterators in c# . Using Iterators is easy, but it's always good to know how this thing works under the hood, right?.

Iterators in C#

CodeProject Have you used yield keyword with c# any time ? I also never used Yield keyword prior to this article. The only thing that drove me to write this article is that Yield uses state machine while doing things . I've some knowledge about state machines concept, which I've studied in my graduation course. But never saw something that uses state machines in practical. Though yield offers a nice mechanism to preserve the state and offer a deferred execution, it is used less in the daily programming basis. But still it's good to know what this yield does.