Code Style Guide
Use tabs of 4 spaces.
Try to keep lines of less than 128 characters, for the sake of readability.
Never leave trailing whitespace.
End each file with a newline so the scanner can easily find the end of file.
Use spaces around operators and after commas.
Create indentation in blocks.
camelCasefor file names and variable names.PascalCasefor function names and class names.SCREAMING_SNAKE_CASEfor constant names.
All imports/requires that are used directly in this file should be at the start of the file.
Omit parentheses when the function does not require arguments.
### Without arguments
fn Method:
# function body
end
# good
fn Method():
# function body
end
# bad
### Arguments
fn MethodWithArguments(arg1, arg2):
# function body
endNever put a space between a function name and its parentheses
Method (arg1, arg2) # bad
Method(arg1, arg2) # goodLast updated
Was this helpful?