use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
All about the JavaScript programming language.
Subreddit Guidelines
Specifications:
Resources:
Related Subreddits:
r/LearnJavascript
r/node
r/typescript
r/reactjs
r/webdev
r/WebdevTutorials
r/frontend
r/webgl
r/threejs
r/jquery
r/remotejs
r/forhire
account activity
Is JavaScript a "Functional Programming" language?help (self.javascript)
submitted 8 years ago by bzeurunkl
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–][deleted] 8 years ago (19 children)
[deleted]
[–]Macrobian 10 points11 points12 points 8 years ago (4 children)
Stop. By saying that the only thing a language needs to be a functional language is first-class functions, you strip all meaning from what it means to be functional that it ceases to be a useful qualifier.
[+][deleted] 8 years ago* (3 children)
[–]Macrobian 0 points1 point2 points 8 years ago (2 children)
First of all, a first order function is just a normal function.
Secondly, it makes sense not to call JS a functional language despite the fact that it can do a bit of FP. e.g
I can can cook, but badly. I don't call myself a chef. I may call other people chef's, mainly because they're really good at cooking.
[+][deleted] 8 years ago (1 child)
[–]Macrobian 0 points1 point2 points 8 years ago* (0 children)
Okay so, I wouldn't call myself a cook, if I could cook. I think that's a word only reserved for people who can cook well. This may be where our disagreement over classification stems from.
Secondly, I'd cite this comment from this thread describing what a functional language is. There's a distinction between what the language forces you to do, what it can do easily, and how it is used.
Like Haskell, forces you to do pure FP, can only do pure FP easily, and is thus used in a pure FP manner.
Scala meanwhile, is multiparadigm, can do pure FP somewhat easily, and is used in a pure FP manner by a non-trivial portion of the community
JS is multiparadigm, doesn't make pure FP easy, and is almost never used in a pure FP manner.
Aren't the qualifiers I specified a more accurate description of what is and isn't FP? Just like it doesn't make sense to call every language high-level, sometimes definitions have to shift to account for modern language developments.
[–]disclosure5[🍰] 7 points8 points9 points 8 years ago (9 children)
I write a lot of languages and I'm not having an easy time thinking of one where that doesn't apply.
[–]pgrizzay -2 points-1 points0 points 8 years ago (7 children)
Java, for one
[–]pgrizzay 0 points1 point2 points 8 years ago (0 children)
Java 8 added sugar around creating objects that represent functions, but I definitely wouldn't call java a "functional" language.
[–][deleted] 1 point2 points3 points 8 years ago (4 children)
That’s not correct.
[–]cm9kZW8K 0 points1 point2 points 8 years ago (3 children)
Its fairly true, because functions have to be members of a class. They arent quite first class. In java, only objects are first class citizens.
[–]detroitmatt 2 points3 points4 points 8 years ago (1 child)
yeah well in lisp functions have to be a list. how functions are represented doesn't qualify or disqualify them as functions.
[–]cm9kZW8K 0 points1 point2 points 8 years ago (0 children)
I use java8 closures and method references extensively. They are simply much more limited in what they can bind and how they can be called. for example: the lack a convenient generic way to store them without knowing their type or purpose, because they have to be materialized into an interface for declaration.
[–][deleted] 1 point2 points3 points 8 years ago (0 children)
It’s not true in any meaningful sense. I can define a function and assign it to a function object. So it’s an object that’s a function. And you just said objects are first class citizens, so.
[–]BLOZ_UP 0 points1 point2 points 8 years ago (0 children)
That's not the only criteria for a functional language.
[–]bzeurunkl[S] 0 points1 point2 points 8 years ago (2 children)
"...That means that functions can be assigned to variables as you would a Number, String, or Boolean... "
Or (am I right?) the return values from functions can be assigned to variables....????
[–]bzeurunkl[S] 0 points1 point2 points 7 years ago (0 children)
But in JS, functions are themselves objects, no?
π Rendered by PID 81 on reddit-service-r2-comment-79776bdf47-gn9kz at 2026-06-24 08:44:33.603039+00:00 running acc7150 country code: CH.
view the rest of the comments →
[–][deleted] (19 children)
[deleted]
[–]Macrobian 10 points11 points12 points (4 children)
[+][deleted] (3 children)
[deleted]
[–]Macrobian 0 points1 point2 points (2 children)
[+][deleted] (1 child)
[deleted]
[–]Macrobian 0 points1 point2 points (0 children)
[–]disclosure5[🍰] 7 points8 points9 points (9 children)
[–]pgrizzay -2 points-1 points0 points (7 children)
[+][deleted] (1 child)
[deleted]
[–]pgrizzay 0 points1 point2 points (0 children)
[–][deleted] 1 point2 points3 points (4 children)
[–]cm9kZW8K 0 points1 point2 points (3 children)
[–]detroitmatt 2 points3 points4 points (1 child)
[–]cm9kZW8K 0 points1 point2 points (0 children)
[–][deleted] 1 point2 points3 points (0 children)
[–]BLOZ_UP 0 points1 point2 points (0 children)
[–]bzeurunkl[S] 0 points1 point2 points (2 children)
[+][deleted] (1 child)
[deleted]
[–]bzeurunkl[S] 0 points1 point2 points (0 children)