Live data from Hacker News

Functional programming in JavaScript is an antipattern

hackernoon.com

1–10 of 92 posts

Re: Functional programming in JavaScript is an antipattern

#5
I like Javascript. As a language. It's fun, enjoyable, and I'm productive in it. There I said it.

I don't mind exploring interesting avenues like immutability, jsx, typescript, declarative or functional styles. I like that JS has enough flexibility to make all of these possible.

I get the fatigue about the endless stream of new frameworks, libraries, approaches, and "new hotness". But I became much more relaxed about it all when I realised it's all completely optional. I can just stick with vanilla JS if I want to, and cherry-pick interesting things as they whizz by. It's the sushi train of programming environments :)

LISP in JS sounds great, I might give it a try. But this does raise a conundrum... if LISP is the ultimate programming language because you can write all the others in LISP, then the fact that this is a LISP written in JS makes it...what?

Re: Functional programming in JavaScript is an antipattern

#6
There are so many JS/Node developers now, and I have worried that JS will ruin dynamic languages for a lot of people, so it's encouraging to hear this written about ClojureScript: "As an average Javascript/Node developer, it hasn’t been difficult for me to learn the language or the ecosystem"

Re: Functional programming in JavaScript is an antipattern

#7
post #3

The flagged comment was accurate - post claims FP in javascript is an antipattern, but then says FP is the most sane way to write javasript. Ergo author is claiming javascript is an antipattern, tldr clojurescript. /shrug

that's a misrepresentation. post claims FP in javascript is an antipattern, so use FP language that transpiles to javascript instead.

Re: Functional programming in JavaScript is an antipattern

#8
post #4

Seems like the author discovered the curse of the excluded middle: http://queue.acm.org/detail.cfm?id=2611829

Interesting article, but I think F# (and other impure FP languages) show pretty clearly that you can have "mostly functional" programming without causing chaos.

Re: Functional programming in JavaScript is an antipattern

#10

I like Javascript. As a language. It's fun, enjoyable, and I'm productive in it. There I said it. I don't mind exploring interesting avenues like immutability, jsx, typescript, declarative or functional styles. I like that JS has enough flexibility to make all of these possible. I get the fatigue about the endless stream of new frameworks, libraries, approaches, and "new hotness". But I became much more relaxed about…

unfortunately this approach does not scale past single developer or multiple klocs of code unless you're really disciplined, but then wouldn't that cognitive effort be better spent elsewhere?
Post reply on HN