Comment on Real quick question about the "break"

amio@kbin.social ⁨11⁩ ⁨months⁩ ago

Ignore it. A lot of people somehow in charge of teaching coding couldn't code their way out of a wet paper bag.

They are in a ton of languages in all kinds of different families for a reason: they are a logical and fairly consistent expression of two fairly consistently logical ways to deal with control flow in the specific case of a loop - exiting an iteration early, either terminating the whole loop or continuing from the next one. Also there's the switch-case case in C-style languages.

Now, there are legitimate arguments for avoiding tons of of exotic control flow shenanigans, but if someone doesn't understand break/continue, then the problem is 100% theirs and nobody should take their advice on anything much, let alone relating to programming.

source
Sort:hotnewtop