3 ms·
And for good reason, in my opinion. Perl, Python, and JavaScript are nowhere near being functional languages, but they all allow creating functions (those are t
by dozzie 11y ago
And for good reason, in my opinion. Perl, Python, and JavaScript are nowhere
near being functional languages, but they all allow creating functions (those
are typically called "closures") and passing them around.
Yes, all these languages allow for functional programming, but it's not their
primary paradigm, and not the one that is only natural when you use the
language.
There must be something different that makes a language functional.
- Mithaldu 11y ago> There must be something different that makes a language functional. The main problem is that "functional" is not a binary attribute, but a matter of degrees. Technical no single language is entirely functional. However all of them are functional to smaller or larger degrees.
- veddox 11y agoI think I didn't express myself quite right. As mightybyte says in his comment on the successor thread to this one (https://news.ycombinator.com/item?id=10812198 https://news.ycombinator.com/item?id=10812198), functional programming is a programming paradigm that focuses on functions as the basic building blocks of a program. (As opposed to, say, objects in OOP.) Everything else that is part of FP flows from this - if you will, that is the essence of functional programming. However, "it has an emphasis on functions" is a rather wishy-washy definition for a functional programming language. Thus I touted first-class functions as a working definition for how to classify a language as functional. It's not the whole story, but it indicates an underlying philosophy. And of course, languages almost always fall somewhere on the continuum of the paradigm spectrum. Even many Lisp dialects have become multi-paradigm nowadays. "Functional" simply means that a language supports functional programming well.