Home

Awesome

Elixir Style Guide

A programmer does not primarily write code; rather, he primarily writes to another programmer about his problem solution. The understanding of this fact is the final step in his maturation as technician.

<cite>What a Programmer Does, 1967</cite>

Table of Contents

The following section are automatically applied by the code formatter in Elixir v1.6 and listed here only for documentation purposes:

Linting

Naming

Comments

Remember, good code is like a good joke: It needs no explanation.

<cite>Russ Olsen</cite>

Modules

Regular Expressions

Structs

Exceptions

ExUnit

Formatting

The rules below are automatically applied by the code formatter in Elixir v1.6. They are provided here for documentation purposes and for those maintaining older codebases.

Whitespace

Whitespace might be (mostly) irrelevant to the Elixir compiler, but its proper use is the key to writing easily readable code.

Indentation

Term representation

Parentheses

Layout

License

This work was created by Aleksei Magusev and is licensed under the CC BY 4.0 license.

Creative Commons License

Credits

The structure of the guide and some points that are applicable to Elixir were taken from the community-driven Ruby coding style guide.