3 ms·
I suggest OO is a useful abstraction because it maps well to the universe we are trying to describe, especially with respect to state. Rule of thumb? Anything
by sonnyblarney 8y ago
I suggest OO is a useful abstraction because it maps well to the universe we are trying to describe, especially with respect to state.
Rule of thumb?
Anything that can reasonably be done in FP should be done there, in 'library' like conditions (some people use the term 'FP core' - I think more as lib).
The point is to parse out as much of the problem into highly individual parts that can be built/tested on their own.
Think of parsers, pre-processors, utilities like lodash, node libraries.
These things tend to be truly stateless.
Then OO for the inherently stateful stuff.
I also think the discussion might be coloured by the type of dev: UI is fundamentally stateful. Very much so and there's no avoiding it. OO lends very well to abstractions such as 'button' and 'text field' etc.. Backend, maybe less so, depending on.