3 ms·
Why do people keep incorrectly insisting that JavaScript is "functional" or "Scheme-like"? It is neither. Merely having anonymous functions does not make a lan
by PommeDeTerre 14y ago
Why do people keep incorrectly insisting that JavaScript is "functional" or "Scheme-like"? It is neither.
Merely having anonymous functions does not make a language "functional". JavaScript does not encourage the use of pure functions. It does not encourage the use of recursion. It does not encourage immutability. It does not have a robust, sensible type system. It does not encourage currying.
It's pretty clear that JavaScript is inherently not a functional programming language. It goes against functional programming techniques in almost all respects, especially when it comes to JavaScript code that's out in the wild.
- eli_gottlieb 14y agoFunctional language != ML-family language.
- chimeracoder 14y agoYes, but we can also say that functional language != Lisp-like language, and Javascript may be functional, but it is not Lisp-like.
- pcwalton 14y ago"JavaScript does not encourage the use of pure functions." Neither does Lisp. "It does not encourage the use of recursion." Neither does Lisp. (Common Lisp has no tail recursion in the spec.) "It does not encourage immutability." Neither does Lisp. (Actually, ES5 does have pretty powerful primitives for immutability, Object.freeze for example.) "It does not have a robust, sensible type system." If you mean static typing, neither does Lisp. "It does not encourage currying." Neither does Lisp.
- ankurdhama 14y agosensible type system means you cannot add string and numbers.