I am hereby sharing with you all some short and nice articles for writing modules in Lua in a clean way.
Actually, the authors are not trying to define "the way to go" or stand as an authority, but they are just sharing their thoughts on the topic,
and their own policies they tend to stick to, mentionning eventually the pros (and cons).
I found the content very much valuable, as there are very much interesting things to learn from, and it might influence your actual style.
Plus, they are all written by some fairly experienced programmers, that's the very reason I am posting them here.
The article who originated is from Hisham Muhammad:
Link: How to write Lua modules in a post module world
The second article is a straight response to the first one. It is from Pierre Chapuis:
Link: How I write Lua modules
Prior to these article, there is also a great post from Kikito, which provides some nice policies/guidelines for module
privacy. The article raises some good points that are also mentionned in the previous articles. Also, it is based on
MiddleClass.
Link: Module privacy
As a complementary reading on the topic:
- Lua-Users : Modules tutorial
- Lua-Users : Various ways to define modules
- Lua-Users : Module() function critiqued