I'm a Systems Reliability and DevOps engineer for Netdata Inc. When not working, I enjoy studying linguistics and history, playing video games, and cooking all kinds of international cuisine.
Ultimately, almost every difference between the two comes from the fact that FP preferentially wants all data to be immutable, while OO wants it to all (or mostly all) be mutable. This in turn favors pure functions and separation of code from data for FP, and side effects and unification of code and data for OOP.
However, that has less impact than you might think on the actual algorithms and data structures that get used, it's mostly just differences in how they're implemented. The same applies to procedural code, it's largely the same algorithms and underlying data structures, just differences in how they're implemented. And that's perfectly fine, especially since you can often implement the same algorithm multiple ways without even switching paradigms.
On that note, one of the most helpful things for me as I've been learning Elixir has been to work on re-implementing things I already know how to do in other languages in Elixir. Because I already know the algorithm and have implemented it before, I don't have to focus as much on the algorithm itself, and can thus focus more on the implementation without having to worry about potentially getting the algorithm itself wrong.
Also, one big thing to remember, iterative looping doesn't inherently require mutability, despite what many FP proponents claim. You can do procedural-style loops just fine in Elixir using Enum.reduce/3 (or Enum.reduce_while/3 if you may need to bail early), it just requires a different way of thinking about the loop itself, and slightly different handling of the loop output.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Ultimately, almost every difference between the two comes from the fact that FP preferentially wants all data to be immutable, while OO wants it to all (or mostly all) be mutable. This in turn favors pure functions and separation of code from data for FP, and side effects and unification of code and data for OOP.
However, that has less impact than you might think on the actual algorithms and data structures that get used, it's mostly just differences in how they're implemented. The same applies to procedural code, it's largely the same algorithms and underlying data structures, just differences in how they're implemented. And that's perfectly fine, especially since you can often implement the same algorithm multiple ways without even switching paradigms.
On that note, one of the most helpful things for me as I've been learning Elixir has been to work on re-implementing things I already know how to do in other languages in Elixir. Because I already know the algorithm and have implemented it before, I don't have to focus as much on the algorithm itself, and can thus focus more on the implementation without having to worry about potentially getting the algorithm itself wrong.
Also, one big thing to remember, iterative looping doesn't inherently require mutability, despite what many FP proponents claim. You can do procedural-style loops just fine in Elixir using
Enum.reduce/3
(orEnum.reduce_while/3
if you may need to bail early), it just requires a different way of thinking about the loop itself, and slightly different handling of the loop output.