I would like to propose the removal of the ability to use `Kernel.unless/2` 
with an `else`-clause.

This proposal is inspired by the seeming consensus between the most 
prominent style guides for Elixir, along with similar consensus in the most 
often cited style guides for Ruby (where this ability exists as well).

Some examples for Elixir:

   - https://github.com/lexmag/elixir-style-guide#no-else-with-unless
   - https://github.com/christopheradams/elixir_style_guide#unless-with-else
   - https://github.com/rrrene/elixir-style-guide#no-unless-with-else

Similar examples for Ruby:

   - https://github.com/rubocop-hq/ruby-style-guide#no-else-with-unless
   - https://github.com/airbnb/ruby#no-unless-with-else
   - https://shopify.github.io/ruby-style-guide/

I have not researched the topic to the degree that I can point to some 
scientific study regarding how comprehensible negated booleans are. 
However, if the style guides are an indicator of community preferences, 
then anywhere they are enforced, `unless-else` will likely be banned.

I have nothing but intuition to go by when it comes to how many Elixir 
users are actually using style guides like the ones above (with or without 
automatic checking), but the people and companies I've worked with 
generally use these guides.

Therefore, this proposal is mostly a question whether this one rule should 
be enforced everywhere, at the potential expense of those who don't care 
much about style guides. I guess that also opens discussion about whether 
other rules could receive similar treatment, but that's a discussion for a 
different thread.

-- 
You received this message because you are subscribed to the Google Groups 
"elixir-lang-core" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elixir-lang-core/6fd77557-3080-496b-af5f-fe51cf9de79b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to