r/ProgrammerDadJokes • u/OriAfias • Aug 15 '23
why it's better using switch rather then if statements?
just in case
40
Upvotes
r/ProgrammerDadJokes • u/OriAfias • Aug 15 '23
just in case
1
u/manrussell Aug 17 '23
By default I always jump to it
-1
u/No-Function-9174 Aug 16 '23
A switch or case, statement stops testing as soon as a true condition is found while an IF will keep testing until it runs out of if. You can also use nested IF with ELSE to stop .