4 ms·
This reminds me of a blog post (about currying specifically) from an ardent FP proponent that I picked up on HN not long ago, where he back-pedals (his own word
by Noseshine 10y ago
This reminds me of a blog post (about currying specifically) from an ardent FP proponent that I picked up on HN not long ago, where he back-pedals (his own word) from a much-shared pro-currying in JS article:
https://hughfdjackson.com/javascript/does-curry-help/?utm_source=ESnextNews.com&utm_medium=Weekly%20Newsletter&utm_campaign=Week%206 https://hughfdjackson.com/javascript/does-curry-help/?utm_so...
On a personal note, immutability is fine, but doing it in Javascript comes at a cost and it always feels like I'm fighting the system (have to deep-copy objects and possibly even `Object.freeze()` objects, space-saving write-on-copy needs to be done by myself, no pattern-matching). So I only do it when I'm sure it is useful. Similar with some other FP concepts that feel natural in "real" FP languages.
Also, very few of the functions that cause me any headaches benefit from being pure (in a way that would help me), because my problem is with the consistency and state of the data in (shared) storage. I rarely have issues within the app itself, so "purity" there does not help me all that much in my very I/O heavy applications. It seems much more suited for data processing.
- bepitulaz 10y agoMy intention to write this article is for introducing FP concept to someone who never touch it. So, imho the best way to introduce FP to a beginner is by using the mainstream language, and for this case I use JS. FP is not a silver bullet, so do imperative. By knowing those 2 paradigms you can get the right tool for the right job. I also don't want to do I/O heavy application with the "purity" thing. Hence in language like Clojure, we can still doing "the side-effect" thing.
- Noseshine 10y agoThe Scala course running (for free, if one ignores the IMHO useless certificate offerings) on Coursera and authored by the guy who also invented Scala in the first place seems to be a great pointer to send people new to FP to. Sure, teaching the parts that are useful (for that system) in Javascript is one more option, but maybe use several methods, and a "real" FP language and an actual FP course with exercises and course forum and all that stuff is probably one of the better options.