r/functionalprogramming • • Jul 01 '22

JavaScript The best resource to learn functional programming in JavaScript

Hi folks,

As the title suggest I'm looking for resources to learn functional programming in JavaScript. All suggestions are welcome - books, courses, etc.

15 Upvotes

31 comments sorted by

View all comments

Show parent comment

3

u/zelphirkaltstahl Jul 01 '22

I think you got confused by inputs on reddit or something. Whom are you replying to? Your quote is not in my comment and has basically nothing to do with my comment either. Haskell is not mentioned in my comment, even though it would be a fine choice for learning.

Anyway, one just has to look at setTimeout and timer ids to find one example, of how messed up JS is. No matter what hoops one jumps through, stuff like that will leak through the abstractions, because it is inherently assuming, that you modify global state and there is nothing you can do to repair how broken it is. Or look at equality operators insanity. Or look at how most implementations do not implement the standard with regards to TCO. It's just how messy JS is. Well, what to expect from a cobbled together language like JS. I guess we cannot expect a solid language design from something made in a week or so.

The OP's question was about learning, not about getting a particular project done until last week. Learning should happen with the right tools. It should enable the learner to understand things. Not with some dumbed down version, which obfuscates the concepts. Learning about paradigms does not require you to use a language, which you might or might not later use on any real project. It is about learning a paradigm, and not about learning a language. If you are not able to apply a paradigm to another language, that means you did not really learn the essence of the paradigm.

Criticizing JS for its many many flaws does not equate to any disqualifying oneself from anything. Actually qualifies oneself, for knowing about mistakes to avoid whenever possible, when having to deal with a language like JS, before one makes a mess. It is just as important to know, what parts are shitty, as it is important to know the good parts, in order to avoid a mess.