lua-users home
lua-l archive

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


Hi Petri

On 14 July 2017 at 09:28, Petri Häkkinen <petrih3@gmail.com> wrote:
>
>> On 13.7.2017, at 16.48, Dibyendu Majumdar <mobile@majumdar.org.uk> wrote:
>>
>>
>> Actually OO is essential tool for organizing large code bases. I am
>> not talking about inheritance and all - but just the ability to
>> organize your code into objects of different types.
>
> This is such a common fallacy that it's giving me the shivers. For example take a look at Linux source code for a very large codebase written by very large team without OO.
>

Hmmm, you are comparing Lua with a statically typed language C which
is not a valid comparison. In C, the kind of OO I am talking about is
prevalent - such as take stdio. The FILE* is the object. Because of
static type checking a function call syntax works fine. In Lua, this
is errorprone as it is a dynamic language - so an API that asks users
to say file:write() helps the user to avoid mistakes.

>
> I think that the 20 years I spent in OO land was a terrible mistake. OOP leads into overarchitecting, poor performance (too much focus on small individual objects rather than data flow) and longer development times (design paralysis).
>

Sure, but OO is a big topic and I was only talking about very basic
object / message passing type design that helps building APIs in a
dynamic language like Lua.

Regards
Dibyendu