Policies for writing Lua modules

General discussion about LÖVE, Lua, game development, puns, and unicorns.
User avatar
Roland_Yonaba
Inner party member
Posts: 1563
Joined: Tue Jun 21, 2011 6:08 pm
Location: Ouagadougou (Burkina Faso)
Contact:

Re: Policies for writing Lua modules

Post by Roland_Yonaba »

ejmr wrote:Thank you Roland for sharing the articles—great reads.
My pleasure!
ejmr wrote:
Inny wrote:That actually raises a good question, how do you guys like require as the verbiage for how an entity uses a component? some time addComponent is used, and in the javascript, extend is what you see commonly (like even in jquery they have $.extend).
This is bike-shedding, but personally I like ‘requires’ more than ‘require’ because I think of variables in code as if they were third-person pronouns in English grammar. Since ‘require’ already has a meaning in Lua maybe something like ‘uses’ or ‘includes’ would be better./quote]

Personally, I'd go for includes. Reminds me of mixins ;)
User avatar
SiENcE
Party member
Posts: 792
Joined: Thu Jul 24, 2008 2:25 pm
Location: Berlin/Germany
Contact:

Re: Policies for writing Lua modules

Post by SiENcE »

Thanks for showing the different class approches.

I'm not sure what to use. I would appreciate a sample class (or more than one for different usecases) for löve libraries. Personally I don't like libraries that polute the global namespace and the calls for constructor and functions should be equal among all.

It's a bit sad that löve has maintained "official" library repository. One for every LÖVE version and one for independant lua-libraries.

Everytime I need something, I have to look at several github, bitbucket and wikis and test which LÖVE version works with it. Also we there are many different licenses for each library and some are incompatible with each other. It's a pain and I really understand why people often code everything thierself.
Post Reply

Who is online

Users browsing this forum: No registered users and 247 guests