News for hackers. Stuff that matters.
Re:What is functional programming? by dozzie on Wednesday December 30, 2015 @08:06AM (#10811891)
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.

Re:What is functional programming? by veddox on Wednesday December 30, 2015 @12:55PM (#10813269)
I 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), 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.

Re:What is functional programming? by Mithaldu on Wednesday December 30, 2015 @09:56AM (#10812253)
> 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.