2 ms·
Well, OO tries to represent entities, and their state, via objects. FP emphasizes immutability. So in OO + FP, objects are treated as immutable data. Functions
by partycoder 10y ago
Well, OO tries to represent entities, and their state, via objects.
FP emphasizes immutability. So in OO + FP, objects are treated as immutable data. Functions create new objects instead of modifying the same object (avoiding side effects).
For convenience you can create functions to access parts of an object instead of creating new objects to achieve the same.