by LAC-Tech · 3y ago · 0 comments
But I really wish FP advocates would learn more about paradigms like OO before criticising them. It's too often levelled against the strawman of industry, imperative, pseudo-oo. Take this:
Components in functional programming are essentially just data types and functions, and these functions work without mutable state, he said.
I could make the same arguments for doing "late architecture" with objects:
Components in object-oriented programming are essentially just objects and messages, and these messages work without mutable state, he said.
I very much doubt this and I suspect it is more of a problem of how you framed it. I'm sure you would see more success if you framed it seeing if the following would compile.
List list = new ArrayList<String>;
and for contravariance ,which is something that is not very common in practice Consumer printHashCode = o -> System.out.println(o.hashCode());
Consumer<String> printStringHashCode = printHashCode;The first example is missing some parenthesis, but it should convoy my point.
The majority of OO around is very mutation based.