My custom functions tend to grow and grow, as time passes. Which worries me, since I prefer to keep anything that’s custom in the same location.
So, here’s what I’m wondering, when it comes to custom functions.
Do I…
-
1. define my functions in an external module (that I call in the main.lua), or
-
2. define all my custom functions directly inside the main.lua?
I expect both work, but I’m looking for a “best-practices” method.
I also ask this to better understand if memory management plays a role here.
If a .lua file gets called, and needs to utilize a function that only one other uses, do I define that function inside the .lua file?
The reason I even thought to ask was from the TabBars Sample code.
On the bottom of each screen.lua file is a function to remove the object and it’s children.
Since I notice it in the bottom of each screen, makes me wonder if duplicating code is possibly teaching a bad practice.
Looking for some thoughts on that.
thanks!
[import]uid: 154122 topic_id: 28170 reply_id: 328170[/import]
[import]uid: 52491 topic_id: 28170 reply_id: 113788[/import]