--
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-co...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-core/ba5370e1-c59e-4180-b8fc-a02402828e90%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
I favor lhs/rhs, it's unambiguous and doesn't force you to work to someone else's expectations of what side the "expected" value should go on.
I favor lhs/rhs, it's unambiguous and doesn't force you to work to someone else's expectations of what side the "expected" value should go on.A convention could be established, as it's been the case in other languages. Nevertheless, I do think that you have a fair point. Then, what do you think of replacing lhs and rhs with the less cryptic left and right? Not that the acronym is hard to guess, but it's still less user-friendly than plain English, IMHO.
--
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-co...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-core/86971ed8-0d22-482f-a5c3-a8799a6fc7b7%40googlegroups.com.
Right could be confused with correct. If the changes happens, make sure the lines still line up, i.e. add an extra space after "left".
I don’t thin expected and actual make sense for elixir. With ==, IMO it is most natural to put the expected value on the right hand side:
assert x == 5
The alternative, assert 5 == x, reads like you are asserting something about 5.
But consider assertions with =: in that case, the expected pattern must go on the left side, and the actual value on the right:
assert %{x: 5} = map
So I don’t think we can consistently consider one side or the other of assertions with operators to always be “expected”.
As for left vs right: I’d be OK with that if there’s a broad consensus from the community but prefer lhs and rhs. I don’t remember when I first learned the lhs/rhs terminology but it wasn’t in my CS classes and I’ve seen it in some other programming languages, too (although I forget where now: I’ve seen this terminology often enough that it’s not notable when I see it anymore). I also like that lhs and rhs has the same number of characters, but left and right do not.
Myron
I still personally think lhs and rhs is fine, and being shown in the terminal, also quite a few characters less. This may prevent word wrapping.