Naming conventions: Difference between revisions

m
(Added Arturo implementation)
Line 192:
=={{header|Arturo}}==
 
There are no strict rules for naming new words in Arturo, apart from the ones generally defined in the grammar. That it is: <code>''any letter lowercase-or-upcase, optionally followed by a question mark</code>''.
 
In practice, a couple of simple naming conventions are followed:
 
* for function names or variable names, all-lowercase is preferred, e.g <code>variable</code>
* names composed by more than one words, we'd use *'''camelCase*''', e.g. <code>myVariable</code>
* user constants could be written with a capital first letter and *'''PascalCase*''', e.g. <code>MainData</code>
* functions returning a boolean value (in Arturo: "predicates") are suffixed with a question mark (<code>?</code>), e.g. <code>prime?</code>
 
1,532

edits