question about spreading my code into many lua files
3 replies, posted
Hello everyone! I was wondering if having my gamemode code spread into many lua files and then including them with include() is bad in any way. For example i have code for each of the F1-F4 buttons in different lua files and lots of other stuff spread like that.
Thanks :3
There is absolutely nothing wrong with organizing your code in a way that makes sense to you.
If you come from a .NET or Java background then i guess it feels normal to spread your code out into sections like i do. I know lua doesn't work with classes in the same way but its much nicer to have your code split up. Since include just pretty much just copy and pastes the code from the specified document to the one your using, it doesn't have any real performance costs.
Splitting your stuff up has its benefits, aye. Especially when it gets too long.
For example:
[img]http://i50.tinypic.com/nffy1y.gif[/img]
Sorry, you need to Log In to post a reply to this thread.