Wikibooks:Featured books/Nominations/Addition/Lua Programming

Lua Programming
I am nominating this book, which I have started working on in January 2013, because it is now complete and I think it is a book of sufficient quality to be featured on Wikibooks’ main page and be considered as a quality book. To comment each of the criteria mentioned in Good books:


 * I believe this book conforms to all the Wikibooks policies and guidelines in a reasonable way.
 * I think it has an appropriate and consistent definition (it is meant to teach the syntax and libraries of the latest version of the Lua programming language to a person with any level of programming experience, with a focus on embedded environments).
 * I am certain that “[a]ll current organizational systems are properly and appropriately used.”
 * I am absolutely convinced that it is “[a]ccurate, comprehensive, and concise enough to effectively teach and learn from in its current state.”
 * It has a table of contents and uses navigational aids to make navigation easier.
 * It is “[f]ree of major issues, like reorganization, orphaned or missing material, copyright violations, deletion, unmaintained, and unresolved disputes.”

There is some cleanup left to do, but this cleanup concerns pages of the old Lua Programming book that need to be history merged and manually merged into the main book. --Mark Otaris (discuss • contribs) 04:20, 19 June 2014 (UTC)

I mentioned orphaned material exists in : on Lua Programming's discussion page, left over from the recent book merger, because there is some overlap between pages and was better to err on the side of caution.

As I was looking over pages I felt the book was poorly organized, for example the expressions chapter begins with "As explained before" and the chapter's emphases is on types and not on expressions as a person would expect. I also felt coverage was perhaps 50% for someone new to the language, for example when talking about Integers and Floating point numbers there is no mention of any reasonable limitations of supported value ranges or precision, which should be considered for portability, or how the exact range depends on configurations when the Lua interpretor was compiled, which should be understand when Lua is used embedded. I also notice a complete absence of coverage and examples for advance uses of the language, like using tables as classes to provide inheritance, polymorphism, data abstraction, etc. Examples for all the metatable methods seem to be missing as well. --dark lama  12:20, 19 June 2014 (UTC) I think the emphasis in the chapter about expressions is on types and operators, which are largely discussed in the types section (it is logical to discuss them there, since different operators apply to different types of values). And I think this is all fine, because expressions, as I have noted in that chapter, are made of values (with types) and operators. It is true that the book lacks more technical details about Lua, but I specifically avoided them because a book meant to learn Lua isn’t the right place to teach that numbers are limited to a specific value. I think technical details of this kind belong in the Lua Reference Manual: they aren’t things people will have to know often, and when they’ll need to know them, people will naturally look there. Furthermore, these details are much less relevant in embedded environments. To be honest, in all the programming I’ve done in Lua, I have never needed to know what the limits or precision of numbers were. I have intentionally avoided talking about objects, inheritance, polymorphism or anything else related to object-oriented programming or other paradigms. The Lua language is designed to allow the use of many paradigms without enforcing or encouraging the use of any of them specifically, and I have followed this design decision by only describing all the mechanisms Lua provides for various programming patterns, without describing how they can be used to enable these patterns (a discussion of object-oriented programming in Lua could easily take an entire chapter and not have much to do with Lua itself). You are right that there are not examples for all the metamethods. I don’t think they are necessary, but adding one or two more examples could make them clearer. I don’t think it’s a major issue. Finally, I think the book is largely comprehensive, if we exclude the technical details that someone wishing to embed Lua in an environment needs to know. This is indeed a huge gap that is missing. It is not necessary to have a comprehensive overview of the language itself, but it would interest many readers of the book, although it does not fit directly in the purpose, which is to describe usage of Lua in an embedded environment (and not how to create a such environment in the first place). I would be really glad if someone more experienced than I am with the C API and embedding Lua could fill this gap, but I do not believe I can do it myself. I’d like to thank you for your comments. --Mark Otaris (discuss • contribs) 15:23, 20 June 2014 (UTC)
 * I’ve just re-thought about what I said about the paradigms Lua enables the use of, and I have changed my mind. If I get the time, I will write an appendix describing how object-oriented programming can be done in Lua. I also wish to write such an appendix about unit testing, and I think there are some other things that could interest readers but that would not fit in the main flow of the book. --Mark Otaris (discuss • contribs) 15:56, 20 June 2014 (UTC)
 * I'm glad you have reconsidered. Put another way, I think people should be able to learn how to write reusable and portable Lua programs. My intent was not to suggest one paradigm over another. People just often use the OOP paradigm when writing reusable and portable Lua programs, because that paradigm is well suited for tables and metatables. Part of writing Lua programs that will work across different computer systems is knowing what assumptions are safe and unsafe to make. The Number type is represented as a double-precision floating-point number, so assuming that "myInteger = 2^64" means myInteger is an integer with no fractions or exponents is an unsafe assumption to make. I think citing the Lua Reference Manual is great, but people should also be able to learn to write safe and reusable code from reading this book without needing to buy another book to learn it, or have access to a working Internet connection after they are done reading this book. I think a featured computer programming book should make a reasonable attempt to teach everything within the scope of the core language. I would question featuring an English book that decided to leave "Z" or compound sounds to some other book for similar reasons. --dark lama  21:02, 20 June 2014 (UTC)


 * This isn't criticism of this book but I just feel there are too many Computing Featured books. Wikibooks needs to show people visiting this site that there is more than just IT books here.  We should have a maximum and minimum number of books chosen as Featured books for each subject.--ЗAНИA [[Image:Flag_of_the_Isle_of_Mann.svg|15px]]talk 21:01, 19 June 2014 (UTC)
 * I have noticed this pattern as well, and I agree: Wikibooks seems to me to have more books about computing than anything else. However, I’d like to suggest another solution than limiting the number of featured books about any given subject: we could, instead, make the distinction between featured books about different subjects clearer and change the rotation system on the main page to show an equal number of books about all the eleven major subjects mentioned in the Card Catalog Office. This would have the added advantage of allowing us to show three featured books, all with different subjects, at the same time on the main page, instead of arbitrarily showing a random featured book, a random Wikijunior book and a random recipe (the cookbook would need its own subject, of course, and Wikijunior is already a category in the CCO. This is hard to automate, but that’s another issue, and this isn’t the right place to discuss any of this anyway. --Mark Otaris (discuss • contribs) 15:23, 20 June 2014 (UTC)
 * I have another solution: Nominate the worst featured computing book for removal. I invite anybody to search the worst ones and nominate it to clean the category. I have already nominated the Basic Computing Using Windows book. I think this one is the least advanced one. Ftiercel (discuss • contribs) 19:19, 21 June 2014 (UTC)
 * I have also seen Lua. BoldLuis (discuss • contribs) 09:20, 18 May 2020 (UTC)