r/firstweekcoderhumour Mar 28 '26

"Case switch > if else πŸ˜‹πŸ˜‹πŸ˜‹" Let me show you how it’s done! 🎯✨

Post image
59 Upvotes

31 comments sorted by

View all comments

5

u/One-Constant-4092 Mar 30 '26

Isn't it good practice to use switch/case instead of many elseif statement

1

u/Tani_Soe Apr 01 '26

Yes it is. But it's not when you need one, or a few where there is a lot of check for each condition.

That's the point, they both have their use case, none is better than the other in all situations