News for hackers. Stuff that matters.
Re:The Power of Lua and Mixins by otikik on Sunday April 06, 2014 @12:37PM (#7541480)
Hi there,

I am the author of the OOP library mentioned on the article.

> I'm very skeptical about OO frameworks for Lua

Me too :)

I think Lua OOP libraries are great in two particular circumstances: for people coming from OOP languages, when starting working with Lua, they serve as a "crutch"; they allow you to start working in a language with paradigms that you are not familiar with with a set of structures you are familiar with.

Later on, once you are familiar with Lua's metatables, you can do most things with plain Lua. 90% of the time, it's just enough.

The remaining 10% comes when you need really advanced stuff - for example, class methods called the same as instance methods in class. Or operator inheritance. Then using a library like middleclass is worth the increase in complexity and the extra dependency.

TL;DR: Use middleclass at the beginning, when you are learning, or at the end, when you need advanced stuff. Don't use it if you just need 1 line of metatable stuff and you know how to implement it in raw Lua.

Re:The Power of Lua and Mixins by feca on Sunday April 06, 2014 @08:44PM (#7543990)
I disagree. Learn the language and discover the new way of doing things it proposes. The approach Lua takes is very elegant, worth learning.