4 ms·
Yes. The article correctly points out potential pitfalls of OOP but glosses over its benefits: > See, mutable state makes shorter English sentences, and the a
by jonahx 13y ago
Yes. The article correctly points out potential pitfalls of OOP but glosses over its benefits:
> See, mutable state makes shorter English sentences, and the agent concept helps make analogies with our fellow humans. In the end, this first impression trumps the fact that avoiding mutable state where possible ultimately yield simpler programs.
- But shorter English sentences are awesome.
- Good analogies are awesome.
- Effectively communicating with our fellow humans is awesome.
Indeed, all these things contribute to simplicity.
I find that often critiques of OOP are actually critiques of poorly implemented OOP. When it's done well, it can retain many benefits of immutability while still mapping more naturally to domain concepts. This talk by Gary Bernhardt is a great discussion of using functional concepts in OOP, and doing OOP well:
https://www.destroyallsoftware.com/talks/boundaries https://www.destroyallsoftware.com/talks/boundaries
The talk "Functional Core, Imperative Shell" is also a must see.
- jeremyjh 13y ago> - But shorter English sentences are awesome. You missed the author's point here. He of course prefers shorter sentences as well. He is complaining that mainstream language syntax is biased in favor of mutability since you need to use an extra keyword to make a const expression. In F# for example it is just the opposite, you have to use the keyword "mutable" in your declaration.