4 ms·
What made me think that functional programming is worth being aware of is that good testing practices head towards things done more easily in functional program
by bordercases 10y ago
What made me think that functional programming is worth being aware of is that good testing practices head towards things done more easily in functional programming, pretty quickly. Programming in functions guarantee a compartmentalization of state and a determinism of the result (as opposed to non-determinism).
Procedural programs and Object-Oriented programs need to postulate concepts like design-by-contract, assertions with explicit precondition/post-condition checks, and unit testing suites as a form of insurance against non-determinism and poor compartmentalization. So it's possible to get this kind of control but only after writing a lot more code.
Going completely stateless is probably foolish though.
As for your heuristic: yes, I agree, a top performer in a common field is a safer bet and a sound strategy. If you're able to secure yourself properly you won't be overcome by a large increase of top performers, if such a thing is possible. We have a lawyer over-supply so I guess in some fields it is.