I really appreciate this suggestion. It would be a breaking change to the
API, so that's a negative and implies that it couldn't actually happen
until Elixir 2.0 I would assume. However, I can confirm that every single
time I've seen an `unless/else` it has resulted in confusing logic and
removing the option entirely will just make codebases clearer imho.

Josh

On Thu, Jan 3, 2019 at 11:26 AM Mikael Muszynski <lindu...@gmail.com> wrote:

> 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 elixir-lang-core+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/elixir-lang-core/6fd77557-3080-496b-af5f-fe51cf9de79b%40googlegroups.com
> <https://groups.google.com/d/msgid/elixir-lang-core/6fd77557-3080-496b-af5f-fe51cf9de79b%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>


-- 
Josh Adams

-- 
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 elixir-lang-core+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elixir-lang-core/CAA1-O0wBG_KDg140BCgBmRKN5ggpJoYjfsK%3D7Lt6qw97NBXtOg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to