3 ms·
I would add a blank line to push 'return "Odd";' from the if, and also add brackets around the if-body if the language allows. There are situations where I all
by cess11 2y ago
I would add a blank line to push 'return "Odd";' from the if, and also add brackets around the if-body if the language allows.
There are situations where I allow else, they tend to have side effects, but usually I refactor until I get rid of it because it'll come out clearer than it was. Commonly something rather convoluted turns into a sequence of guards where execution can bail ordered based on importance or execution cost. It isolates the actual function/method logic from the exit conditions.