lua-users home
lua-l archive

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


> On 7 Sep 2018, at 23.41, Sean Conner <sean@conman.org> wrote:
> 
> It was thus said that the Great Petri Häkkinen once stated:
>> 
>> I would remove ’:’ and ’self’. I never use them in my code and they support bad habits.
> 
>  What bad habbits?  The excessive use of OOP?
> 
>  -spc

I’m sorry, I somehow forgot to check back on this.

I’m talking about OOP in general. Every OO codebase I’ve worked with has been an overdesigned, hard to maintain mess. In my opinion, the invention of OOP was a misstep, leading to analysis paralysis (so many ways to model the program as classes) and poor performance (caused by too much emphasis on abstractions and code reuse rather than efficient data flow — see Data Oriented Design).

Luckily more and more programmers are beginning to realize this (including pretty much all experienced programmers I personally know).

For me it took almost two decades in C++ land to realize it. After that I wrote a pretty substantial OO codebase in Lua, still OO because classes was all I could see back then. Now I’ve been working on a Lua codebase with only free functions for 2+ years and it feels much cleaner and easier to work with than any of the OO stuff I’ve done before.

Especially with a powerful dynamic language such as Lua I see no need for rigid classes & inheritance.

Petri