4 ms·
I think you mix things. FP has nothing to do with stateless. Languages all have nothing to do with statelessness or statefulness, this is an application archite
by Uchikoma 15y ago
I think you mix things. FP has nothing to do with stateless. Languages all have nothing to do with statelessness or statefulness, this is an application architecture term.
Objects have state, as have immutable data structures.
"doesn't use higher-order functions,"
But they use higher-order objects.
"classes and methods are designed for "inheritability"
No, at least for 10 years it has been debunked in Java that
inheritance is a good thing. Inheritance outside of some small domains like GUI libraries is a bad thing as inheritance is too rigid. Most bad Java developers use inheritance because they've been teached OO in a completly wrong way with dogs and cats or cars and trucks.
I think the common understanding for years in Java/C# etc. is that composition is much better than inheritance.
This article from 1998 describes the problem of inheritance vs. composition in java
http://www.artima.com/designtechniques/compoinhP.html http://www.artima.com/designtechniques/compoinhP.html
"Care to show any open-source Java code that uses FP techniques?"
No, because to be frank, I have not much knowledge about Java open source. And the projects I've looked into (Apache comes to mind) have sub-industry quality or are outright awful. Not sure why this is the case though.