
What is functional programming? - bloat
http://blog.jenkster.com/2015/12/what-is-functional-programming.html
======
veddox
The title is rather misleading, IMO. What the article is really about is side-
effect free programming.

This is indeed covered very well, the author manages to explain both what
side-effects are and why it makes sense to avoid them in a clear, succinct
style with useful examples. Thumbs up for that!

However, functional programming is about much more than avoiding side effects.
AFAIK, the defining factor for whether a give language can be classed as
functional is whether it has functions as first-class objects. That means: can
functions be created (and returned) by other functions? Can functions be
passed as parameters to other functions? This is a huge area that was
completely ignored in the blog post.

~~~
dozzie
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.

~~~
veddox
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](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.

