I am using Python for my example, but my question is referring to programmming languages in general.
def some_function(eggs): if eggs == 1: do_something_1() elif eggs == 2: do_something_2() elif eggs == 3: do_something_3() else: do_error() return do_something_4() do_something_5() do_something_6() (This is just an example. My functions will not be called do_something_x.)
Would putting a return in the else like this be a bad programming practice? Would it be a better idea to put
do_something_4() do_something_5() do_something_6() in each of the if/elifs?