4 ms·
I'm pretty sure C++ (and any language for that matter) has more than enough quirky features to obfuscate any piece of code. No need to read this article for tha
by rapala 12y ago
I'm pretty sure C++ (and any language for that matter) has more than enough quirky features to obfuscate any piece of code. No need to read this article for that. But if 20 years of experience makes lazy streams seem unfit for production, then someone has spent 10 years burying their head so deep in the sand that their feet are barely showing. Java's iterators, Python's generators, you work with them even in C. And is it not obvious that one needs to really know what they are doing if they are working as a professional developer?
The example of the article was simple of course. But solving the problem of printing Pythagorean triples was not the aim of the article. The aim was to show what makes lazy streams tick, to show that they can be implemented in C++ and that an uniform interface can be provided with functor, monoid and monad. Finally, the simple problem was solved with the new tool to show the inversion of control.
PS. std::vector is a stateful functor.
- throwaway7548 12y agoDon't get me wrong. I like functional approach. I am developing in functional languages as well as in C/C++. I think these techniques actually do have a place in the production level code. But, the mail point of the post was, that if you write an article like that, it should start from a warning to novices. This point of view is based on the experience of having to deal with fuckups from novice developers, who were trying to use and abuse the language to the full extends of their abilities. Including fuckups of my own. PS. std::vector is a container.