3 ms·
Functional code would be totally different, I guess.
by sinuhe69 7y ago
Functional code would be totally different, I guess.
- pmontra 7y agoProbably. This is my experience with the case of the unbalanced if. When it happens to me in Python or Ruby, I return immediately from the smaller branch and move the other branch out of the if, to the main level. When it happens in Elixir... It doesn't happen because I don't use ifs there. I write two versions of the same function. One matches the condition for the then branch, the other the condition for the else one.