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

If you are writing a complex algorithms then an imperative style is usually going to be clearer (and more performant), but when dealing with higher-level code that is just moving data around and doing some relatively straightforward mutations, then functional code can be much more straightforward and intelligible. When you introduce concurrency then that is where I think pure FP really shines. Writing concurrent code with a pure FP effect system like ZIO is so much nicer (and safer!) than writing concurrent code in Java (or any other language I've ever used).


ZIO (particularly with the V2 release just done) explicitly aims to be beginner friendly and accessible compared to other "pure" FP and effects libraries though

This isn't my experience trying to read documentation and tutorials with similar libraries in both Scala and Haskell

I would go so far as to say that ZIO is like the Python of the realm. It's practically oriented and beginner friendly first and foremost. Also Scala is easier to understand than Haskell, but that's an opinion.


Agreed, I think it's not so much that pure FP is too abstract and complicated. It can actually allow really clean, usable abstractions. It's just that many pure FP libraries for some reason try to explicitly model category theoretic abstractions so you end up needing a lot of theory to be able to get your bearings. ZIO is built on the same theoretical foundations but is designed so that you don't need the theory to be productive.

That's all just to say that the issue isn't FP in general, but the way FP has been implemented in beginner-unfriendly ways.




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

Search: