4 ms·
I agree with everything in this article except its conclusion, that we should dump every existing language for new projects and switch to a pure functional one.
by dtagames 3y ago
I agree with everything in this article except its conclusion, that we should dump every existing language for new projects and switch to a pure functional one.
This ignores the tremendous experience and sunk costs we have in the JS/TS environment -- in which we have the ability to write fully functional programs if we want to. Does the compiler enforce it? No. Like Lisp on which it was partially based, JS lets you program in many paradigms.
The author admits that functional has a long on-ramp. It took me years to grok functional[0], and I met its inventor when I worked at IBM. If the difficulty is real, that's even more reason to provide a gradual path to functional by modifying portions of existing JS/TS programs to make them more functional. Since all useful programs have side effects (and all programming is imperative in execution), these abstractions are just for people -- not the underlying machines. There is no such thing as a pure functional program. All software is either more or less functional in style. JS/TS and its support of all the key pillars of functional, is an idea way to get there.
[0] https://medium.com/gitconnected/functional-programming-in-typescript-18ac096bb551 https://medium.com/gitconnected/functional-programming-in-ty...