Earlier quoted context omitted.
I'm on the fence about re-binding variables. I don't really mind it and have gotten used to the pin operator when I need it. I actually use variable re-binding quite a bit but always only in situations where I want a prime. def foo(bar) do bar = decorate(bar) {:ok, bar} end I like that better than calling it something like `new_bar`. I kind of wish there was prime syntax along the lines of `bar' = decorate(bar)` but…
my preference is to only use rebinding if I need to rename something more than once (can happen, in with blocks), and when I do it I postfix-sigil with ! as a code annotation to remind myself to watch out when refactoring the code. def foo(bar!) do bar! = decorate(bar!) bar! = some_more(bar!) {:ok, bar!} end
bar
|> decorate()
|> some_more()
|> case do
result ->
{:ok, result}
end