-7
Real quick question about the "break"
(sh.itjust.works)
Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!
Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.
Hope you enjoy the instance!
Rules
Follow the wormhole through a path of communities !webdev@programming.dev
Using breaks is completely standard in some situations. Using breaks and continues can be very useful and still end in clearly understood code in some other situations. It is however, very easy to end up with nonsense code using both, and if its an introductory course just telling you to ignore them isn't that crazy an idea.
I seriously think that if you're using a continue, at best it's just a bit less clear way to structure something, and at worst the codes a kludged together nightmare. There's definitely good uses for break, but if you think you need a continue you should take a step back and reevaluate what you're writing.
You're the closest to agreeing so far, thanks for the comment.