workmad64 wrote:
In functional programming, the concept of an object is not needed and at times can be completely unnecesarry (or even a hinderance). With C#, everything is an object (my understanding is that structs are POD objects essentially, but are treated a bit differently because of that) which reduces the paradigms it really supports.
Bull.
Code:
var evens = myList.FindAll(x => (x % 2) == 0);
I see what you mean about the objects getting in the way :\
And we're not talking about using functional languages, we're talking about solving problems in a functional way. Hell, even boost::lambda is implemented using classes. And if that's not enough, just look at all the classes in <functional> from your C++ stdlib.
workmad128 wrote:
As for whether C++ or C# is better for functional programming, its fairly moot. C# has delegates and anonymous delegates for lambda functions. C++ has the equivalents from boost (and TR1 I think, but not sure). Neither will be quite as good as an actual functional language for the paradigm as the syntax used isn't geared towards it, but both support it probably to the same degree.
boost::lambda is not the equivalent. Delegates are like ordinary functions, so they allow multiple statements (C++ lambdas do not).
And it was never mentioned that either C# or C++ make a very good functional language, I wanted to point out that C# supports it better than C++ just to knock you down a peg. I question whether you even know C# well enough to be a credible critic.
I think you need to jump off the C++ bandwagon a little bit there workmad3 ;)