minetest-mods / craftguide

:book: The most comprehensive Crafting Guide on Minetest
Other
43 stars 20 forks source link

Lua Debug library called #77

Closed Wuzzy2 closed 5 years ago

Wuzzy2 commented 5 years ago

This mod calls the debug Lua library, which it shouldn't do.

You should exert care when using this library. The functions provided here should be used exclusively for debugging and similar tasks, such as profiling. Please resist the temptation to use them as a usual programming tool: they can be very slow. (…)

https://www.lua.org/manual/5.1/manual.html#5.9

kilbith commented 5 years ago

Thanks for the info, but this isn't used in performance-critical code and it is useful for debugging actually.

Wuzzy2 commented 5 years ago

My point is that debug is called in PRODUCTION code which is a really bad idea. It's not just about performance. Frankly, I trust the Lua developers here more than you. When they say to not use debug, I will not use debug. ;-)

Anyway, looks like you only use it for introspection. So that could be replaced with hardcoded strings.

Anyway, I already removed this in my MCL2 fork.

kilbith commented 5 years ago

Some items in everyday life are intended for a sole and specific purpose, yet we can sometimes divert them from their original usecase for other purposes for which they are not originally intended.

Same with the code.