Generators make no sense to me

I am not being obtuse. I am attempting to understand your viewpoint in good faith. I was not until now aware that there was a difference between cyclomatic complexity of a function and in a function (or that cyclomatic complexity makes sense from a black box perspective). Can you give me a link to your definition?

The fact these capabilities exist in myriad other languages is not proof in and of itself that the features are good. However, when millions of developers have found a feature a useful abstraction and when there isn't a significant concern among them about complexity, difficulty to learn, or otherwise, it shifts the burden of proof in this conversation. On the one hand, we have a massive amount of industry experience, plenty of examples showing benefit, sound theory as well. On the other hand, we have your opinions about "single entry, single exit" being super important, unexplained concerns about maintainability, testability, and call stack issues without any data to suggest these are issues real programmers would face in practice.

I can assure you that games or engineering sandbox scenarios were not the motivating use cases for generators.

Teachability is a super important aspect of any feature, but I don't know why you don't think your junior devs are capable of learning this feature. Millions of junior C# devs have done so without issue. Regarding maintainability, still waiting for examples showing where this problem lies. I also haven't heard of "blocking / call stack issues".

/r/javascript Thread Parent