News for hackers. Stuff that matters.
Re:Comparing Ember Octane and React by flowerlad on Tuesday May 12, 2020 @02:40PM (#23157905)
Functional programming actually brings some benefits to backend code. To take advantage of the extra cores in a CPU you add threads, but if these threads are continually needing to lock in order to access shared state then concurrency is diminished. The more cores you have, the more threads you have, and then the more you have to lock. Functional style solves this problem by not having mutable state, thus eliminating the need to lock.

But when it comes to JavaScript these benefits don't exist. That's not to say there are no benefits at all to incorporating some functional style into JavaScript code, but wholesale replacement of OOP with functional style is not warranted.

There are no comments on this comment yet.