Support Me: / angelsix Part of the series of tutorials on programming C# for beginners Understand what enumeration, enumerators and enumerable are, how we create them and when and why we use them
Really helpful in understanding what's actually going on. A lot of tutorials try to simplify things so much it actually makes it harder, or just blow over things like "that's just what you write and you get the answer" or are so technical it goes over my head. This is just right for making sense of something that keeps coming up and kept feeling intimidating.
Amazing explanation that actually goes into the logic behind name and usage! There have been some changes in .Net6 and the IEnumerable @3:25 is actually wrapped by IList. You'll just have to press F12 once you click on IList and then you will find IEnumerable
I appreciate the effort in your videos. There are far less informative tutorials compared to yours on other platforms which even cost money. Thank you for doing this.
great vid tbh would recommend to anyone who is at this stage to take 20 mins to watch this vid... I would however not mark this as Beginners. Your speed and the topic is for me beyond Beginner stage.
Hi AngelSix, thanks for creating amazing content. I would like to know whether you are going to do some videos about C# 8.0 and .NET Core 3.0? I would appreciate that so much!
Hi Luke, I have a video (series?) request. Would you have any advice for those thinking of setting up a software company, getting the word out and getting those first few sales in? I think lots of us would love to do this but there is a lack of advice about the non software side. Any advice you can offer would be much appreciated.
Thanks for the tutorial, very helpful! Just can't get over scrolling in Coding tutorials, it makes it almost impossible for me to keep track at that point.
Excellent Tutorial , after watching it (several times) I managed to create a similar IEnumerable for strings, and then, to prove I understood it, I created one to handle a complex Class Object named BankAccounts to it, and to my huge surprise, after a bit of to and froing with it, it actually worked after some issues converting the objects of this type being passed to the Enumeration code. One stumbling block I hit was that I wanted to pass a LIst in place of the arrays you have used, so rather than a BankAccount [ ], which it accepts, it doesn't seem to allow a List object to be used internally to the IEnumerable/IEnumerate system ?? I therefore had to grab the data from my "Test" system, into a list form it's Dictionary format, and then create an array from that with .ToArray() which is a bit clunky. Is there any way to use Lists in this functionality, or are we stuck with internal arrays ? Thanks again for teaching me me how to do this - Great stuff.
I dont quite understand when you would want to use this. It just seems easier to have a List and loop over it when I need to do such things. Any simple real-world example of when it's best to go for IEnumerable? Is it merely to control iterating over a list of unknown length, one at a time so you don't store the entire list in memory?
Mainly when you don't want to load a large list into memory all at once, loading over network on infinite scroll, or dynamically generated lists that can be calculated. So saves memory and speed up loading
Great stuff Sir thank you for the work you put in this. I have a noobish question maybe someone reading these might help. Where are the function of the IEnumerator interface for the Array for example MoveNext() implemented? IMHO it should have been implemented by the the class Array but I don't see any function called MoveNext() in the list of methods in 03:01. While I am already at it is there a way to see the internal implementations of those methods?
An array is not enumerable. It is a known size. MoveNext is there because enumerators do not necessarily know their size, or if something is next until its enumerated over. An array is fixed size so you can just loop ForEach
@@AngelSix Thank alot for answering, still I am wondering the Class Array implements the Interface IENUMERABLE and so the class array implements the function GetEnumerator which itself hast to return an Enumerator that Enumerator has to be specific for the array. I still dont get where that special ArrayEnumerator with its special functions is created. Is it done in the implementation of Getenumerator()?
I think that because the Array implements IEnumerable, it must implement a function called GetEnumerable(); It is that Enumerable class that implements the MoveNext() method.
Would be nice if you could post the source code for videos like this. Not everything, this seems a bit more theory so having source code on my own screen and studying it I think would help me learn faster.
First of all, thank you for your greet content!!! It´s awesome. I´m a new programmer and i love your videos. Is it possible to make a video to Component Object Model?
@@AngelSix In that case, 16:17 mIndex should also be initialised to 0 instead of -1? Otherwise it doesn't make sense that it is initialised with one value but reset to a different value?
@@AngelSix btw is it possible to use that IEnumerable.Current with just a foreloop or does it need to be constructed as in the video to be able refer to IEnumerable from other classes as well?