When programming it\'s almost instinctive deciding when to use a for loop, or foreach, but what is the determining factors or problem space for choosing to use Enumerable.Range?
You can think about Enumerable.Range
like a tool of retriveing subset of a collection.
If content of collection are value types, you create also a new instance of every of them.
Yes, you can do it with for
loop, by setting correctly bounds of iteration, but thinking such way, almost all LINQ
can be implemented in other ways (at the end it's just a library).
But it have short, concise and clear syntax, that's why it's used so widely.