Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

It’s hardly JS developers who think functional programming is cool. Scala became huge in the JVM world because of its functional nature. Kotlin includes a lot of functional programming, and Java itself continues to add functional capabilities.

And if you look at the .Net side of things, C# has basically been on a path to look increasingly like F# with every release. And of course, LINQ, one of C#’s most popular features, is little more than a functional subset of C#.

Arguably its backend developers moving to the front end who have been trying to bring functional concepts to front end programming.



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.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: