21

I’m working with a “senior” developer with a full decade more experience than me who didn’t know that short-circuit evaluation works differently for OR than it does for AND. He argued with me for a good hour and a half that in the expression (a || b), b would never be evaluated if a is false — and that this couldn’t possibly be the source of the bug he was trying to fix.

🙄

Comments
  • 5
    That seems like a situation that could have been solved by a simple experiment.
  • 1
    @Voxera There were plenty of experiments and demonstrations. It’s not that he was being obstinate; he was trying to understand what I was telling him but just didn’t get it.
  • 2
    @coditect ok, its hard if they don’t even believe their eyes :/
  • 2
    Shouldnt it be that b will never be evaluated if a is true?
  • 0
    Lesson: After decades of coding we forget the basics like logical operator.

    My guess: Your next argument session will be about ternary operator.
Add Comment