christopheradams

christopheradams

The Elixir Style Guide

I was recently asked to step up and become the maintainer for the Elixir Style Guide. It was, I believe, the first, and is now the most popular, community-driven style guide for Elixir.

The guide aims to be very accessible and open to contributions, and if you’re willing to send us your changes and feedback, it’s a great way to give back to the Elixir community that has given us so much.

As the guide says:

Style matters. Elixir has plenty of style but like all languages it can be stifled. Don’t stifle the style.

If you have a little time please check the open issues and pull requests, and leave a comment or question. Looking forward to hearing from you!

Most Liked

josevalim

josevalim

Creator of Elixir

@lexmag, from Elixir, maintains a style guide mostly aligned with Elixir source: https://github.com/lexmag/elixir-style-guide. If we are ever going to adopt something as official, which is unlikely, that one is the most likely.

11
Post #7
Eiji

Eiji

How about merge this guide with: Credo’s Elixir Style Guide and add issue to Credo github project?

Qqwy

Qqwy

TypeCheck Core Team

For some things it can clearly be seen that one kind of writing will be less error-prone than another.

But in many other cases, the exact method used is not as important as that you (and your team) are consistent: Things like tabs vs. spaces, order of pattern-matching in parameters (x = %{} or %{} = x?), names given to exception classes, et al. I really like Credo’s approach of saying “It doesn’t matter which one you like best, but pick one and stick with it”.

I think it is great that we have multiple style guides, because this means that people will stay conscious about the choices w.r.t style they make.

I think that right now we do not need an officially endorsed (or enforced) style guide, because Elixir’s syntax itself is already a great tool to help developers write reasonably readable and consistent code.

Where Next?

Popular in Discussions Top

jeramyRR
This is an interesting article to read. Elixir’s performance, like usual, is excellent. However, it seems like the high CPU usage is co...
New
blackode
Elixir Upgrading is so Simple in Ubuntu and It worked for me Ubuntu 16.04 git clone https://github.com/elixir-lang/elixir.git cd elixir...
New
New
New
shishini
I think this twitter post and youtube video didn’t get as much attention as I hoped I am still new to Elixir, so can’t really judge ...
New
Crowdhailer
I’ve been hearing much about the new formatter and it’s something I have been keen to try. I find examples buy far the most illuminating...
248 19148 150
New
AstonJ
Please see the new poll here: Which code editor or IDE do you use? (Poll) (2022 Edition) It’s been a while since we first asked this, I...
208 31107 143
New
PragTob
Hey everyone, this has been brewing in my head some time and it came up again while reading Adopting Elixir. GenServers, supervisors et...
New
hazardfn
I suppose this question is effectively hackney vs. ibrowse but we are at a point in our project where we have to make a choice between th...
New
New

Other popular topics Top

9mm
I am constructing a JSON object (map) and I need to conditionally set a field. I’m trying to write proper elixir-way code… and I’m at a l...
New
lastday4you
I wanted to check elixir version in phoenix because i found that my elixir is 1.5 but when i use Enum.chunk_by it said the function is un...
New
skosch
To my knowledge, put_in, Map.update etc. all have the one limitation of not automatically creating intermediate keys when needed (for exa...
New
Patoshizzle
After calling mix ecto.create I get this error: 17:00:32.162 [error] GenServer #PID<0.412.0> terminating ** (Postgrex.Error) FATAL...
New
johnnyicon
Hi all, I've just started learning Elixir and Phoenix Framework, so please pardon my n00bness at this stage. I'm trying to use Postg...
New
Emily
I have VueJS GUIs with the project generated using Webpack. I have Elixir modules that will need to be used by the VueJS GUIs. I fore...
New
hariharasudhan94
I would like to know what is the best IDE for elixir development?
New
WestKeys
Currently suffering from paralysis by [HTTP client] analysis. This is rather unusual in Elixirland as there tends to be consensus on the ...
New
marick
I had some trouble figuring out how to make many-to-many associations work. Once I got it working, I wrote a blog post. Because I'm a nov...
New
hariharasudhan94
Lets say i have map like this fetching from my database %{"_id" => #BSON.ObjectId<58eb1a7a9ad169198c3dXXXX>, "email" => "XX...
New

We're in Beta

About us Mission Statement