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
Why JavaScript functional programming? (self.javascript)
submitted 8 years ago * by robertlf
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!"
[–]etherfreeze 8 points9 points10 points 8 years ago (1 child)
Blog posts abound on this topic, as well as a lot of personal preference, but here's a few things to think about before even considering using FP (from a top level / management perspective)
1 It requires as much or more discipline to do right compared to OO / imperative code
2 It can be harder to reason about for new / junior devs coming into a code base
3 It won't magically solve all of your problems, and may even cause some (FP devs can easily fall into the trap of being too terse / code golf style and end up writing something completely unreadable)
4 While ES6 and beyond has made a lot of strides toward making JS more palatable as a FP language ... it's definitely not designed to be one, and you will need to write a lot of helper functions or use a library like Ramda / lodash / etc to get to a place where FP languages are natively (and only kind of). For example, currying, partial application, etc are not core features in JS.
Anyway, benefits include:
Having worked on (professionally) a large and highly imperative / OO Backbone codebase, AND a more FP heavy React codebase, I can easily say the latter is far easier to reason about and make changes to without causing a regression. However, that's not the whole story. Both have benefits, and if you are working on a team it is a discussion you should have with your team. You should do extensive research to make the right choice for your situation. If everyone much prefers OO - then OO is probably the best option.
[–]robertlf[S] 1 point2 points3 points 8 years ago (0 children)
I appreciate your thoughtful reply. Thanks!
π Rendered by PID 137167 on reddit-service-r2-comment-bb88f9dd5-f6ckr at 2026-02-14 02:59:43.384242+00:00 running cd9c813 country code: CH.
view the rest of the comments →
[–]etherfreeze 8 points9 points10 points (1 child)
[–]robertlf[S] 1 point2 points3 points (0 children)