Some basic questions!

Hello all,

Some newbie questions for you!..

  1. Does the use of whitespace and comments in lua files matter, or make much difference, in terms of file size? Does Corona, for example, compress the code in each lua file and strip anyway whitespace? Or is this generally so insignificant and low that there is no need to optimise this? 

  2. For a lua file, is there a limit in terms of how long (or how much code) you can use? For example, I have a lua file that is close to 2000 lines of code, including whitespace and comments…

  3. Also, I was wondering, if i am building an app that does not use images at all, can i get rid of:

    imageSuffix = {["@2x"] = 2,["@4x"] = 4},  

…in my config.lua file or do/should i need to still leave this in? For example, does the Apple Default and Icon images need to use this setting or is this purely for my own files?

Thanks for any feedback!

Hi @Appvism,

On the first two questions: basically it doesn’t matter. You should comment as much as needed for you to understand/follow the code. As for total lines of code, I’m not aware of any “limit”. There are some internal limits on the number of local variables declared, but that’s a separate issue and related to scoping.

On the third question, if you’re not using images, those lines can be removed. They’re only for Corona’s dynamic image selection feature. If you’re doing a text-based / vector-shape-based app, those are unnecessary.

EDIT: for the app icon sizes, please refer to this guide under “Custom App Icons”:

http://docs.coronalabs.com/guide/distribution/buildSettings/index.html

Hope this helps,

Brent

OK thanks for the reply Brent!

Also, just wondering, if i have a variable to keep track of the game score, is there a maximum limit this score value can go to? For example, i have a check with something like: 

if totalScore\>=999999999 then ... end  

…can i use something higher than the value of 999999999, like 999999999999? 

Cheers,

I’m not aware of a limit, at least within “practical” means. I tested the values you suggest above and it works fine. :slight_smile:

Hi @Appvism,

On the first two questions: basically it doesn’t matter. You should comment as much as needed for you to understand/follow the code. As for total lines of code, I’m not aware of any “limit”. There are some internal limits on the number of local variables declared, but that’s a separate issue and related to scoping.

On the third question, if you’re not using images, those lines can be removed. They’re only for Corona’s dynamic image selection feature. If you’re doing a text-based / vector-shape-based app, those are unnecessary.

EDIT: for the app icon sizes, please refer to this guide under “Custom App Icons”:

http://docs.coronalabs.com/guide/distribution/buildSettings/index.html

Hope this helps,

Brent

OK thanks for the reply Brent!

Also, just wondering, if i have a variable to keep track of the game score, is there a maximum limit this score value can go to? For example, i have a check with something like: 

if totalScore\>=999999999 then ... end  

…can i use something higher than the value of 999999999, like 999999999999? 

Cheers,

I’m not aware of a limit, at least within “practical” means. I tested the values you suggest above and it works fine. :slight_smile: