Code | Quality |
---|---|
Function Name ( with ; parameters ) |
good |
Function Name(with; parameters) |
bad |
Use this format:
List (
"foo";
"bar";
)
Instead of this:
List (
"foo" ;
"bar" ;
)
Primary examples of "continuing" code include the If() and Case() functions. Note the use of the space before the semicolon in the test portion of each condition.
Case (
True = 1 ;
"This will be returned first.";
False = 0 ;
"While true, we won't see this.";
"This default will never show"
)
Code | Quality |
---|---|
Let ( ~something = FunctionName () ; ~something ) |
good |
Let ( ~something = FunctionName ; ~something ) |
acceptable |
Single platform development?
In order to stay cross-platform compatible with regards to code editing, the space on either side of the semicolon facilitates easier parameter selection using the mouse. However, if you are working within a team of developers or all developers are working on the Macintosh, it is acceptable to remove the space between the parameter and the semicolon. This increases readability, but does force the developer to be familiar with using keyboard selection strategies, such as advancing to the next word and using the arrow keys and shift (or alt/option) to navigate and select text.