Comment

Comment by PaulStatezny

> I didn't fully grok OOP until I saw how composition and dynamic dispatch can be used in real code to create abstractions and flexibly swap out different implementations for your interfaces.

> You could build a chatbot that supports Discord, Slack, and IRC dynamically at runtime...

As a counter-point, OOP isn't necessary for dynamic dispatch.

None of these dynamic features you describe are necessarily any harder in non-OOP languages — or easier in OOP languages.

You can do the same kind of dynamic dispatch in Elixir, Go, etc.

OOP really is a preference, not a differentiator.

Source: I cut my teeth on OOP and used it for many years. Been using Elixir for the last half a decade, and have zero loss of ability to do things like this.

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton