Quote:
Originally Posted by andyh2000
...
Andrew
|
A mentor of mine once told me that a mentor of his said it can be useful to get rid of nested if else statements when you can because it can make the code less convoluted. So take this with a grain of salt. For example,
Code:
if current_state == 0:
set_lights_green()
return
if current_state == 1:
set_lights_red()
return
set_lights_blue()
But often the code doesn't lend itself to this treatment.