h1. Kotlin Coding Style

This page contains the current coding style for the Kotlin language.

* if in doubt default to the [Java Coding Conventions|http://www.oracle.com/technetwork/java/codeconv-138413.html] such as:
** use of camelCase for names (and avoid underscore in names)
** types start with upper case
** methods and properties start with lower case
** use 4 space indentation
* public functions should have documentation such that it appears in [Kotlin Doc]
* Kotlin does not have fields as a primary concept in the language - it only has properties. Avoid the use of prefixes on properties, such as _ or m\_ or other kinds of notation; If you need access to a backing field of a property, use the $ prefix: $foo to refer to a field behind property foo; never create a private property and call it \_foo

h3. Colon

There is a space before colon where colon separates type and supertype and there's no color where color separates instance and type:

{code}
trait Foo : Bar {
    fun foo(a: Int): String
}
{code}

h4. See also

[Kotlin Doc]