🚀 C# Progress Academy - Become a job-ready C# and Angular web developer to land your dream developer role: bit.ly/45vbPUg
@kopilkaiser8991 Жыл бұрын
Definitely a must watch video for every programmer willingful to understand "yield" statement in C#. I myself, have been able to understand thanks to you🎉❤
@phattruong708610 ай бұрын
It's really really good, I can understand the "yield" in C# thanks for your video! Nice job!
@AhmedMohamed-pf2by4 ай бұрын
thanks, video made sense and was easy to follow! i liked that you showed what the naive approach would be in the start of the video
@zane42187 ай бұрын
Is a yield return function setting up an isolated separate thread? That's what it feels like, but I'm having a little bit of trouble holding the logic in my head (which honestly is the case for a lot of multithreading, this would actually be simpler than normal for that.)
@benderios6 ай бұрын
The best explanation
@thomasschroter3802 Жыл бұрын
Nothing wrong with the content. However, this example shows well how much imperative programming interrupts the actual flow of the program and the developer is constantly forced to use control structures. A declarative approach would clearly have an advantage here.
@Golden_games Жыл бұрын
but if the max value is large will it not take longer and possibly throw an error
@hemanichius3941 Жыл бұрын
You mean too large for an int
@Golden_games Жыл бұрын
@@hemanichius3941 no I mean if you input a higher value like when he used 1billon will it not still take much time to complete
@MrOudoum Жыл бұрын
@@Golden_games Of course it does. Sadly he did not show the console then you would see why yield is very good in this situation. It will print the messages as soon as it iterates through each item because yield provides the next value in the iteration. Before the change to yield the methode had to finish (IEnumerable) and after that it will iterate through the foreach loop.