3 ms·
I don't disagree with the article. However, I'd also argue that JavaScript is good in that it is the best option for functional programming which has an approa
by harimau777 7y ago
I don't disagree with the article. However, I'd also argue that JavaScript is good in that it is the best option for functional programming which has an approachable syntax and jobs available.
I guess what I'm saying is that I'd love to be able to start using a better language that allowed me do functional programming on the job. However, I'd rather keep using JavaScript than use a better language that didn't allow me to use functional programming.
- swalladge 7y agoLet's replace javascript with ecmascript6 here. The recent ecmascript specs are really nice for functional programming. Javascript in all its backwards compatible glory doesn't have much niceness in the way of FP.
- dahfizz 7y agoHave you ever used... A functional language? JavaScript has lambdas and functions, but I would hardly call it functional. Having types and immutability and pattern matching are pretty important. Being able to run multithreaded would also be very nice.
- harimau777 7y agoWith Lodash I also get currying and sort of pattern matching (via conditional execution). To be fair, I probably should have said that I was considering the situation when commonly used libraries are available. Immutability isn't enforced, but I have all the tools that I need to choose to handle data immutably. I completely agree with you on types though. I don't know that much about TypeScript, but perhaps it would help? You definitely have a point that functional programming would be much better in JS if these features were built in and/or enforced. However, the problem is: what's the alternative? Haskell/Clojure/Ocaml jobs aren't exactly common. And at least in terms of Haskell and Ocaml, I've found the syntax to be pretty arcane.