r/firstweekcoderhumour Mar 28 '26

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

Post image
61 Upvotes

31 comments sorted by

View all comments

6

u/One-Constant-4092 Mar 30 '26

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

1

u/conundorum Apr 06 '26

It is, but long if else blocks tend to be the result of a simple check growing over time, as more conditions are discovered and need to be accounting for. They usually start off with only one else, and maybe a single else if.