lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


> On 18 Sep 2018, at 0.25, Coda Highland <chighland@gmail.com> wrote:
> 
> There's nothing wrong with OOP in general. There is a tendency for
> some engineers to overengineer, this is true, and some tools end up
> demanding overengineering (Java, I'm looking at you), but nothing
> about the paradigm in and of itself is necessarily bad.

Well, that’s the theory but practice is altogether different matter. :) OO systems start nice and well behaved but when time goes on and new features are implemented over existing ones they all fall to mess. Nobody has time to remodel the classes when requirements change. So in my opinion just letting it go is the most sane & time saving solution.

> a bunch of free functions means that you expect all of
> your things to behave the same way all the time

Polymorphism can still be achieved for example with lambdas / callbacks in your data. Actually this is much more powerful than classes, because you can mix those callbacks any way you like (unlimited combinations vs. fixed number of classes), override them per instance rather than needing to create a new class (specialization for those weird cases), add them dynamically (do this after that) etc.

Petri