back

by Rochus·9mo ago·view on hn ↗
The article presents OOP and FP as mutually exclusive paradigms where one must be entirely wrong. In reality, modern software development benefits from hybrid approaches. Most current languages support both paradigms, and experienced engineers choose appropriate tools for specific problems.

The interview question about static constructors and self-instantiating programs represents anti-patterns that professional OOP developers also avoid, not inherent OOP features. This is equivalent to judging FP by its worst callback-hell examples.

The ad hominem attack on prominent OOP authors doesn't improve the quality of the article, and dismissing patterns as "crutches" ignores that FP has equivalent patterns (monads, functors, lenses).

1 comments
What's mutually exclusive is immutability though.

There is an enormous difference when mutability is opt-in.

Most OOP languages seem to require mutability, I'm not sure if there is a possibility to avoid it.

I guess elixir could count as oop, but not in the canonical terms, just according to Alan Kay definition

Well, OCaml is immutable by default, isn't it? Rust has no inheritance, but at least supports polymorphism, and ordinary bindings are immutable. There are OO languages where values of an object can only be set at construction time, or objects can be constant, or types can be private (as e.g. in Ada), etc.
From my understanding OCaml is considered an FP language, and Rust I have no idea, it's a very special case.

The problem with mutability by default is that immutability loses so many advantages...

Caml is/was an FP language. OCaml has an "O" prefix because it is an OO & FP multiparadigm language.