[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Thought experiment: what would you remove from Lua
- From: Coda Highland <chighland@...>
- Date: Tue, 18 Sep 2018 14:32:14 -0500
On Tue, Sep 18, 2018 at 1:17 AM, Petri Häkkinen <petrih3@gmail.com> wrote:
>
>> 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
Not all OOP looks like C++ or Java. Carrying callbacks in your data is
still OOP.
Having an object with optional event handlers is a form of OOP that's
actually OLDER than C++.
It's even still OOP if you're just dealing with stuff by using
consistent interface contracts even if there's no direct coupling or
dependency.
Don't throw the baby out with the bathwater.
/s/ Adam