3 ms·
So. The problem is: Someone used an aggressive language (aggresive in the sense: The language does not defend the programmer from his own stupidness, but also
by tetha 17y ago
So. The problem is:
Someone used an aggressive language (aggresive in the sense: The language does not defend the programmer from his own stupidness, but also does not hinder his freedom), used a certain feature of this language and fell on his face. Thus, the feature is bad.
Uhm. I guess, in this logic, everything of C, C++, Python (at least) is bad, because you can easily fall on your face with the more efficient idioms. Certainly, you cannot iterate over the generator twice and you cannot iterate over an iterator twice (remember: a list can return multiple iterators, one at every time it is asked), but if you know a certain functions requires multiple iterations, well, pass it a list or a set or whatever is capable of generating an arbitrary amount of iterators (or even do things like itertools.repeat(generator) :) ). The point remains:
This is a feature of an aggressive language, and you need to know your code slightly better (meaning: more documentation, or more code immersion) in order to reach maximum efficiency. This point holds with pointers, with templates and with generators. But it also holds, that well-used pointers, well-used templates and well-used generators can speed up code magnificiently :)
So, overall, I don't really see the point of this article, besides someone who should go and use some defensive language.