Good naming examples include: [Project number] - Data Use Agreement - [Title of research project] Approval - Change to employee travel policy - February 2014.
JavaScript variable names should not start with a numeral (0-9). They must begin with a letter or an underscore character. For example, 123test is an invalid variable name but _123test is a valid one. JavaScript variable names are case-sensitive. For example, Name and name are two different variables.
Class names should be nouns, in mixed case with the first letter of each internal word capitalized. Try to keep your class names simple and descriptive. Use whole words-avoid acronyms and abbreviations (unless the abbreviation is much more widely used than the long form, such as URL or HTML).
You might want to look at the Clojure library coding standards on the developer Wiki - this is probably the most comprehensive list that I've seen.
To your specific points:
You might want to take a look at this non official style guide.
There are some interesting guidelines on naming written by Stuart Sierra which suggest that:
age
instead of calculate-age
)create-
for constructing and get-
for retrieving), reserving the bang swap!
changes to mutable references.send-message
instead of message
)connection
instead of ->connection
) except when the input type must be explicit (input-type->output-type
)products/price
instead of products/product-price
) and prevent local clashes in let bindings-fn
suffixThere is an interesting set of naming conventions documented in a comment by Taoensso in his Encore library.
He proposes names using !
for side-effects, ?
for booleans,
$
for expensive operations, _
as dereffable,
*
for macros; plus a few other combos.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With