News for hackers. Stuff that matters.
Re:React is 10 years old by petilon on Tuesday May 30, 2023 @05:23PM (#36131043)
> but the style of programming it introduced to many millions of web developers made a sizeable chunk of them interested in fp

Why would that be? React is not functional, and the style of programming has nothing to do with functional programming. It is fundamentally inconsistent with functional programming.

Re:React is 10 years old by cdelsolar on Tuesday May 30, 2023 @11:47PM (#36134250)
Uh, the style of it is extremely functional-like, even if it’s not actually functional.
Re:React is 10 years old by petilon on Wednesday May 31, 2023 @12:42AM (#36134542)
What about it is "functional-like"? Does functional simply mean not using classes?
Re:React is 10 years old by kamikaz1k on Wednesday May 31, 2023 @12:07AM (#36134343)
Why is it fundamentally inconsistent?
Re:React is 10 years old by petilon on Wednesday May 31, 2023 @12:43AM (#36134548)
Re:React is 10 years old by epolanski on Wednesday May 31, 2023 @03:09AM (#36135397)
It's good that I wrote:

> Not in the sense that React itself is functional or declarative (it isn't albeit its roots are in Ocaml)

At the beginning of React there were two different components: class-based and pure functional components. Pure functional components rendering has always depended _uniquely_ on its props. No surprises. This introduced a very large number of developers to indeed a declarative/functional style of programming which only depended on the inputs in an era when components were written with local state. Several libraries like Redux, which was Elm-inspired, further introduced millions of developers of combining a declarative/functional/reactive paradigm with handling state without mutations but messages.

Context, then hooks and other features broke this paradigm, whatever is the final result does not depend anymore uniquely on the inputs. React team believes the net result is positive.

I myself with others who commented in this thread and plenty of people I know where introduced to this style of programming with React and then migrated to more strict libraries in the TypeScript ecosystem or other languages such as PureScript, Scala, Elm, Haskell, etc.