3 ms·
I'm always surprised at the continued confusion of what FP is. I think that a lot of it is defensiveness about not wanting to lose whatever someones's favorite
by dizzystar 9y ago
I'm always surprised at the continued confusion of what FP is. I think that a lot of it is defensiveness about not wanting to lose whatever someones's favorite OO feature is.
In FP, nearly everything you like about OO exists except for one critical thing: global mutation. Even James Gosling, the creator of Java, encourages programmers to use mutation as a last option.
In other words, if you are programming well, you are nearly doing FP anyways.
- nlawalker 9y ago>> In FP, nearly everything you like about OO exists Is there an FP pattern that's analogous to an immutable object? The reason I like objects has nothing to do with mutability or state, it's the convenience of organizing a bunch of related functionality into a named class. When I instantiate it, I effectively get a named value through which I can access a bunch of functions that have all been closed over the same immutable values.