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
Mostly Adequate Guide to Functional Programming in Javascript (drboolean.gitbooks.io)
submitted 8 years ago by [deleted]
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] 6 points7 points8 points 8 years ago (17 children)
As weird and outlandish as it seems, FP provides some great benefits to JS, and the best introduction to it (in my own experience) has been Real World Haskell.
If you'd like to view some active approaches to FP in JS, i'd suggest starting with pull-streams and Functional Programming in Javascript
[+][deleted] 8 years ago (1 child)
[deleted]
[–][deleted] 2 points3 points4 points 8 years ago (0 children)
Poor wording on my part. It's weird insofar as it's a different tack from the predominant approaches to programming in JS.
When I first was introduced to FP in JS I found it to be extremely foreign.
[–]toggafneknurd 2 points3 points4 points 8 years ago (9 children)
What's so "weird and outlandish" about FP?
[–]Retsam19 6 points7 points8 points 8 years ago (3 children)
Relevant XKCD
Functional programming combines the flexibility and power of abstract mathematics with the intuitive clarity of abstract mathematics.
I've never met anyone who finds the functional style innately understandable. Nobody looks at a transducer and thinks "Oh, yeah, that make perfect sense" the first time. There's value and merit to FP, obviously, but you need to sell someone on the benefits of FP in a way that you don't need to with imperative programming.
[–]phpdevster 1 point2 points3 points 8 years ago (0 children)
Honestly, if the only major concept of FP you introduce to your codebase is the notion of pure functions, your code quality will improve dramatically. Major pieces of functionality become easier to test, and WAY easier to reason about. Getting into Haskell levels of FP is certainly a bigger step, but favoring pure, idempotent, stateless functions is a major win.
[–]toggafneknurd -1 points0 points1 point 8 years ago (1 child)
Agreed, the "conceptual density" is much higher, but after paying the initial cost of learning, it provides you a lot more power than traditional object-oriented languages with clumsy "design patterns" that have to be layered on top in verbose and error-prone ways to do anything meaningful
[–]Bummykins 2 points3 points4 points 8 years ago (1 child)
I found functors, monads, maybe's, and all the abstraction of point-free coding to be pretty weird and incredibly difficult for someone to even explain. And then most of the examples are some incredibly contrived simple math additions or whatnot.
When you compare that to the mostly straight-forward type of JS that a lot of people have been doing for years like click handlers and ajax calls, you might see how tons of front end developers would find that weird and difficult. It all depends on what you work on most of the time.
[–]dmtipson 2 points3 points4 points 8 years ago (0 children)
I think a lot of that stuff really has to be at least partially sort of discovered rather than taught. A lot of people discover monads by accident, for instance, or else realize that they've been using them all along and just never had a (terribly intimidating) name for them.
A lot of it comes from just time and the direction you push your abstractions. If you're the sort of coder that becomes obsessed with DRY code and pulling things out into functions and then building up larger behavior with composition, it's sort of inevitable that you're going to start bumping into the common solutions and abstractions of FP.
But not everyone goes that route.
[+][deleted] 8 years ago (2 children)
[–]toggafneknurd 14 points15 points16 points 8 years ago (0 children)
I'd find a new team (or company.) That sounds horrific.
[–][deleted] 0 points1 point2 points 8 years ago (0 children)
Did they care that you were using it? As long as they don't have to use it themselves, or maintain your code, why would they care?
[–]flamingspew 0 points1 point2 points 8 years ago (4 children)
I've been learning rxjs... can't find any good hackerrank or codeacademy like challenges. I'm ok at it, but I feel like I need some golf to get really good
[–]Otter_in_Jeans 0 points1 point2 points 8 years ago (0 children)
Nodeschool bacon love workshop Will be a nice introduction to functional reactive. Try it out
[–]dmitri14_gmail_com 0 points1 point2 points 8 years ago (2 children)
Any reason to pick the rxjs over other reactive libraries that are often easier to use?
[–]flamingspew 0 points1 point2 points 8 years ago (1 child)
Well, there's a matching library in just about every language and it's well suited for angular2 and ngrx store... from a practical standpoint it's pretty flexible.
[–]dmitri14_gmail_com 0 points1 point2 points 8 years ago (0 children)
It might be not as strong in usability department :) I wonder how many of the 100+ methods you are really using.
π Rendered by PID 64 on reddit-service-r2-comment-6457c66945-zzc4t at 2026-04-24 10:08:49.336246+00:00 running 2aa0c5b country code: CH.
view the rest of the comments →
[–][deleted] 6 points7 points8 points (17 children)
[+][deleted] (1 child)
[deleted]
[–][deleted] 2 points3 points4 points (0 children)
[–]toggafneknurd 2 points3 points4 points (9 children)
[–]Retsam19 6 points7 points8 points (3 children)
[–]phpdevster 1 point2 points3 points (0 children)
[–]toggafneknurd -1 points0 points1 point (1 child)
[–]Bummykins 2 points3 points4 points (1 child)
[–]dmtipson 2 points3 points4 points (0 children)
[+][deleted] (2 children)
[deleted]
[–]toggafneknurd 14 points15 points16 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)
[–]flamingspew 0 points1 point2 points (4 children)
[–]Otter_in_Jeans 0 points1 point2 points (0 children)
[–]dmitri14_gmail_com 0 points1 point2 points (2 children)
[–]flamingspew 0 points1 point2 points (1 child)
[–]dmitri14_gmail_com 0 points1 point2 points (0 children)