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

"People who closures all over the place in JS" have IME much to gain in learning about and using FP.

- understanding paradigms of state handling enables you to make conscious choices about what to aim for, how to design your data model, etc

- learning the benefits of having all data as values, except at the edges of the system (instead of object refs encompassing mutable state and/or IO handles)

- eg the resulting ability to reason about your system in a principled way (this can still be hard to mentally reach, even given all the ingredients, if you're very used to the "poking the mystery ball" way of relating to your app)

- how it comes together so you can just test a subset of your code at your REPL, being able to paste the input datastructure there (because it's just values, not active objects) without having your app framework up and running in a stateful context in browser or server environment.

Another strength of FP is about paralell programming. The bottleneck of parallelizing code by using multiple threads is concurrency bugs which come from mutable data. Immutable data and referential transparency is close to a silver bullet for this. (But JS programmers aren't as likely to appreciate this since JS is nearly always single-threaded)



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

Search: