3 ms·
Those don't really seem that far off from common OO wisdom which still seems prevalent in the industry, except for the lambda thing. Mostly that seems like you
by sqeaky 10y ago
Those don't really seem that far off from common OO wisdom which still seems prevalent in the industry, except for the lambda thing. Mostly that seems like you are thinking for yourself and have real reasons for what you think, and it happens to be closer to most OO folks, than most FP folks.
On the Lambda thing, you are right that it makes no functional difference. I do think it makes a small readability and maintainability difference. Most languages I use don't allow, or at least it is poor practice, to make classes in line. With C++ passing a lambda to and std function is much nicer and easier to read than creating a functor (a separate class with operator() instead of apply() as you described), because it lets you keep the code being passed in the function that cares.
- lacampbell 10y agoJust to be clear I'm not advocating everyone write their own anonymous function-object every time they want to map over something, just that "x -> x * x" can be short hand for such a function-object with nothing lost. Industry OO doesn't seem much like OO at all. C# constantly adding new and innovative syntax to make getters and setters as simply as possible (much simpler than writing an immutable class with a proper constructor) suggests to me my views are a bit fringe as well.