Live data from Hacker News

The Power of Lua and Mixins

notmagi.me

21–25 of 25 posts

Re: The Power of Lua and Mixins

#21
Hi there,

Thanks for writing this article.

I believe we spoke about this very subject in reddit not long ago. In that conversation I mentioned that I'd rather use composition instead of mixins for most of the examples you made.

Rather than repeating myself, here's the link, in case someone wants to see an alternative approach:

http://www.reddit.com/r/gamedev/comments/1uni58/the_power_of...

Re: The Power of Lua and Mixins

#22
I've always found mixins in other languages to be absolutely horrible in terms of maintainability. They often lead to all sorts of sins and junk-drawer design. I'd prefer to see something like a clojure-ish protocol library.

Re: The Power of Lua and Mixins

#23
post #19
post #4

I've bee studying Lua very thoroughly recently because I'm working on a toy language based on its runtime, so I gained a certain appreciation for some of the concepts Lua uses. Given this background and my general coding experience up to now, I'm very skeptical about OO frameworks for Lua, because they mostly provide mechanisms that are neither true to the language's design nor are they really necessary. Specifically…

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…

I disagree. Learn the language and discover the new way of doing things it proposes. The approach Lua takes is very elegant, worth learning.

Re: The Power of Lua and Mixins

#24
post #14
post #13

Earlier quoted context omitted.

Not bashing PHP in any way (I'm a PHP developer myself), but what would you consider the PHP paradigm?

I like PHP as well, however it's the wrong language to build byzantine OO inheritance structures in. Yet, that's what new feature development seems primarily directed at: new OO functionality that adds a lot of complexity and new opportunities for developers to shoot themselves in the foot. Listening to PHP core developers' presentations, I get the impression they're trying to imitate Java. The per-request execution…

> The per-request execution model can be played as an incredible strength, but the moment some framework comes along, starting off by loading all of its code, then instantiating a myriad classes, subclasses, traits, and other crap just to serve a simple request - that's where slowness and bugginess comes from.

Really good point, never thought about it this way.

Re: The Power of Lua and Mixins

#25
post #18

Animated pictures of a Jump'n'Run game make blog posts really hard to read. Might be related to the way human attention works, but well.

It's not unrelated, there's a hammer animation after the Hammer class, and dust after Dust.

I did not even get to that because I could not concentrate.
Post reply on HN