Hacker News new | ask | show | jobs
by nesarkvechnep 2067 days ago
Polymorphism is not an OOP concept. Behaviors are like interfaces, not inheritance. Behaviors allow dynamic dispatch but let's not try to fit OOP where it doesn't belong.

When people talk about how similar are OOP and FP languages they miss the elephant in the room - immutability.

1 comments

Maybe my PL history is wrong, but weren't interfaces made popular by java as a way to avoid C++ - style problems with multiple inheritance?

> When people talk about how similar are OOP and FP languages they miss the elephant in the room - immutability.

>> What elixir doesn't have is pass-by-reference

But immutability is not INHERENT to the FP style. In the strictest sense BEAM languages are not immutable, because message-passing is not state-safe, and there's also the Process library (and NIFs), but practically they are. Julia is also a very powerful FP language that isn't immutable by default, and Swift is an OO-ish? is it OO? language that is pass-by-value by default.