4 ms·
I liked functional but had issues figuring out how to not have to keep sending in objects every time I make a method call. Partials only worked for so much...
by some_account 9y ago
I liked functional but had issues figuring out how to not have to keep sending in objects every time I make a method call. Partials only worked for so much...
- smt88 9y ago> keep sending in objects every time I make a method call Classes and objects can actually be good syntactic sugar to solve this same problem. You can get a lot of the benefit of functional programming by writing immutable classes without any inheritance. The first argument of any method in the class is assumed to be the class itself, which is "POJO/POCO" and immutable -- "this" becomes a read-only keyword.
- some_account 9y agoYeah it seems like a good way to get the best of both worlds :)