This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revision Both sides next revision | ||
lua_conventions [2015/02/04 20:20] dean4devil A header is always nice |
lua_conventions [2015/02/04 20:24] dean4devil Lua Hightlighting! \o/ |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Lua Code Conventions ====== | + | Lua Code Conventions |
+ | ============================== | ||
* Be consistent. | * Be consistent. | ||
Line 13: | Line 13: | ||
Bad Code: | Bad Code: | ||
- | <code> | + | <code lua> |
function f(sArg1 , ... ) | function f(sArg1 , ... ) | ||
assert(type(sArg1)== "string", "me wants a strign!") | assert(type(sArg1)== "string", "me wants a strign!") | ||
Line 28: | Line 28: | ||
Good Code: | Good Code: | ||
- | <code> | + | <code lua> |
function f(name, ...) | function f(name, ...) | ||
checkArg(1, name, "string") | checkArg(1, name, "string") |