Q. Is it a good practice to declare all function and variable names as local in the forward declaration section of a storyboard or composer scene? The reason i’m asking this is i’ve come across errors like “attempt to index some function_or_variable (a nil value)”. These errors are usually scope related errors. What i’d like to know if the coding style below is good practice to avoid such errors?
-- forward declaration section -- variable names local mesg, ctr, initValue,finalValue,score,num\_of\_coins... -- function names local postMesg,checkCoins,buyCoins..... -- forward declaration section ends function checkCoins() -- code end function buyCoins() -- code end function postMesg() -- code end
i tried searching on Corona Labs Forums and came across two similar questions but with no answers -http://forums.coronalabs.com/topic/40072-question-on-best-practices-for-storyboard/?hl=%2Bstoryboard+%2Bbest+%2Bpractices
Can you share your best practices for usage of variable and function names in Corona Storyboard or Composer API’s , many thanks in advance!