Are there any negative side effects to setting hooks this way? - Printable Version +- Cuberite Forum (https://forum.cuberite.org) +-- Forum: Plugins (https://forum.cuberite.org/forum-1.html) +--- Forum: Plugin Discussion (https://forum.cuberite.org/forum-8.html) +--- Thread: Are there any negative side effects to setting hooks this way? (/thread-3043.html) Pages:
1
2
|
RE: Are there any negative side effects to setting hooks this way? - ShadowCone - 01-09-2018 And that is when code becomes completely unintelligible at the first glimpse. At least put a comment in there to load all hooks inside that hook table. Apart from that, don't we have that feature that one plugin can unload and reload other plugins? Isn't that problematic too with putting code outside initialize? RE: Are there any negative side effects to setting hooks this way? - xoft - 01-09-2018 The plugin unloading / reloading shouldn't be affected by this, it's just a style of coding; unloading and reloading work on the entire Lua states, so anything in them gets destroyed and re-created. As for the style itself, it brings one more level of indent into the whole functions, and most IDEs aren't too helpful when using functions inside tables, as opposed to regular functions. So I'd advise against it. |