HomeForumResearchGuide
<< back to guide home

As with any other language, in Dana you can write code in whichever way you like. The Dana standard library uses a particular set of conventions, however, which you might like to follow to make your own code look similar.

Variable names and function names

We use camel-case for variable and parameter names, and also for function names, where the first letter is lower-case. Example variable names would be:

age

firstName

The use of camel-case here helps to differentiate variable names from some built-in language operators, which do not use camel-case, such as isset or hastype.

Type names

We use camel-case for type names, where the first letter is upper-case. In our convention this distinguishes type names from variables and package names. Example type names would be:

String

JSONParser

FileSystem

Where a type name would be two groups of acronyms, we use an underscore between the two groups, for example:

AES_CBC

RSA_OEAP

Package names

We use lower-case for package names, and each of our standard-library packages or sub-packages are formed of a single word.