3 ms·
In Elixir I would enumerate the cases with four definitions of the same function. Four lines of code, done. It looks similar to what you did. But I would tell
by pmontra 7y ago
In Elixir I would enumerate the cases with four definitions of the same function. Four lines of code, done. It looks similar to what you did.
But I would tell them this is the simple and boring code I would run in production but probably not the smart code they want to see in the interview. Unfortunately smart code is often full of bugs and it costs more to deploy and maintain.
- yakshaving_jgt 7y agoWhy would you write four cases? You only care about two of the cases.