Avoiding if-else Hell: The Functional Style - eviltoast
  • BrianTheeBiscuiteer@lemmy.world
    link
    fedilink
    arrow-up
    4
    ·
    2 months ago

    To each their own. Some won’t like the repeating code and some won’t like the distributed logic (i.e. you have to read every if and if-else statement to know when the else takes effect). I think the use of booleans like isDriverClose makes the repeated logic less messy and reduces inefficiency (if the compiler didn’t optimize for you).