开发者

Is using the break statement bad practice?

Merged with Break statements In the real world [closed].

I've been told by professors and peers at my university that using the break statement is bad practice, but through my coursework开发者_Go百科 haven't come up with a great reason why. Those who claim that it is bad say that it's a "get out of jail free card" and that you can always avoid using it.

My guesses for why its considered bad would be that you could possibly skip some cleanup code after the break, or similarly exit some control structure in an inconsistent state.

Is there any reason why using break is(n't) bad practice?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜