User:Ganaram inukshuk/Provisional style guide for Lua: Difference between revisions

Ganaram inukshuk (talk | contribs)
Ganaram inukshuk (talk | contribs)
mNo edit summary
Line 10: Line 10:
=== Naming and declaring variables ===
=== Naming and declaring variables ===


Variable names should be short and descriptive, written <code>snake_case</code>. Exceptions to this include counter variables, like with <code>i</code> in for loops. Boolean variables are prefixed with <code>is_</code>. Constants are named using <code>TRAIN_CASE</code>.
Variable names should be short and descriptive, written in <code>snake_case</code>. Exceptions to this include counter variables, like with <code>i</code> in for loops. Boolean variables are prefixed with <code>is_</code> wherever possible. Constants are named using <code>TRAIN_CASE</code>.


All variable declarations should start with <code>local</code>.
All variable declarations should start with <code>local</code>.