<p>C# has the keyword called <a href="http://msdn.microsoft.com/en-us/library/9k7k7cf0(VS.80).aspx" rel="noreferrer">yield</a>. VB.NET lacks this keyword. How have the Visual Basic programmers gotten around the lack of this keyword? Do they implement they own iterator class?  Or do they try and code to avoid the need of an iterator?</p>

<p>The <a href="http://msdn.microsoft.com/en-us/library/9k7k7cf0(VS.80).aspx" rel="noreferrer">yield</a> keyword does force the compiler to do some coding behind the scenes. <em><a href="http://blogs.msdn.com/oldnewthing/archive/2008/08/12/8849519.aspx" rel="noreferrer">The implementation of iterators in C# and its consequences (part 1)</a></em> has a good example of that. </p>

I personally just write my own iterator class that inherits from
```
IEnumerator(Of T)
```
. It does take some time to get it right, but I think in the end it's better to write it right then try to avoid it. Another method that I have done is to write a recursive method that returns
```
IEnumerable(Of T)
```
and just returns
```
List(Of T)
```
and uses
```
.AddRange
```
.