3 ms·
Yes, that's what he also says, but this works best for very simple parameters. If things get interesting and you have bigger data structures there is (too much)
by andi999 6y ago
Yes, that's what he also says, but this works best for very simple parameters. If things get interesting and you have bigger data structures there is (too much) performance penalty. I am a bit cherry picking here, but let me just cite "Actual functional languages are implemented in ways that make this not as disastrous as it sounds, but if you do this with typical C++ containers you will die."
- Jtsummers 6y agoHe's specifically referring to one thing that shouldn't be done in a functional style in C++, not saying "you can't really do that" as you originally post. The rest of the article is advocating a move towards pure-r functions in C++ (at least in addition to impure, mutating functions).
- andi999 6y agoMaybe I come from a different direction, lots of data. If you do any functional programming on these you are creating new lists/vectors (the type) left and right. To me this is the gist of functional programming. So when I started the article, I was wondering how would you do that in c++, well his answer is you shouldn't. So when you are saying it is just one thing for me it is like a car without an engine (also only missing one thing). (the other thing about functional programming is the widespread use of recursion, but this is not even mentioned in the article)
- neuromanser 6y agoI can't tell if your reading comprehension is completely shot, or if you're willfully misrepresenting the drift of the article.