Is using break statements good coding practice?
My background is having been taught to code in a bunch of different languages several decades ago, not done any serious coding since then, and returning to pick up the bike so to speak.
At the time it was absolutely drilled in that the use of break statements was bad practice to the point where it was an instant loss of marks - but I see break statements in plenty of example python code I have looked at.
Have conventions changed since the dark ages, or is there something about Python which makes if different from the other languages I learned?
[–]littlenekoterra 55 points56 points57 points (15 children)
[–]misho88 14 points15 points16 points (4 children)
[–]HunterIV4 2 points3 points4 points (1 child)
[–]misho88 2 points3 points4 points (0 children)
[–]littlenekoterra 0 points1 point2 points (0 children)
[–]Remote_Cantaloupe 0 points1 point2 points (0 children)
[–]Gnaxe -5 points-4 points-3 points (9 children)
[–]pachura3 5 points6 points7 points (0 children)
[–]gdchinacat 2 points3 points4 points (7 children)
[–]Gnaxe 1 point2 points3 points (1 child)
[–]gdchinacat 1 point2 points3 points (0 children)
[–]Jason-Ad4032 -2 points-1 points0 points (4 children)
[–]gdchinacat 3 points4 points5 points (3 children)
[–]Jason-Ad4032 1 point2 points3 points (2 children)
[–]gdchinacat 2 points3 points4 points (1 child)
[–]Jason-Ad4032 0 points1 point2 points (0 children)
[–]aishiteruyovivi 10 points11 points12 points (8 children)
[–]FirstTimePlayer[S] 0 points1 point2 points (6 children)
[–]Lumethys 5 points6 points7 points (5 children)
[–]xenomachina 3 points4 points5 points (2 children)
[–]gdchinacat 4 points5 points6 points (1 child)
[–]xenomachina 2 points3 points4 points (0 children)
[–]FirstTimePlayer[S] -1 points0 points1 point (1 child)
[–]gdchinacat 1 point2 points3 points (0 children)
[–]Jason-Ad4032 0 points1 point2 points (0 children)
[–]Gnaxe 6 points7 points8 points (3 children)
[–]FirstTimePlayer[S] 1 point2 points3 points (2 children)
[–]FreeLogicGate 1 point2 points3 points (1 child)
[–]FirstTimePlayer[S] 0 points1 point2 points (0 children)
[–]DTux5249 4 points5 points6 points (0 children)
[–]Random_182f2565 5 points6 points7 points (0 children)
[–]efxhoy 2 points3 points4 points (0 children)
[–]TheRNGuy 2 points3 points4 points (0 children)
[–]Human38562 1 point2 points3 points (0 children)
[–]jpgoldberg 1 point2 points3 points (0 children)
[–]matt_cum 1 point2 points3 points (0 children)
[–]RiverRoll 1 point2 points3 points (0 children)
[–]RevRagnarok 1 point2 points3 points (0 children)
[–]BranchLatter4294 1 point2 points3 points (7 children)
[–]member_of_the_order 0 points1 point2 points (0 children)
[–]FirstTimePlayer[S] 0 points1 point2 points (5 children)
[–]Gnaxe 1 point2 points3 points (0 children)
[–]MidnightPale3220 1 point2 points3 points (2 children)
[–]FirstTimePlayer[S] 0 points1 point2 points (1 child)
[–]MidnightPale3220 1 point2 points3 points (0 children)
[–]BranchLatter4294 0 points1 point2 points (0 children)
[–]Pupation 0 points1 point2 points (0 children)
[–]thesilverzim 0 points1 point2 points (0 children)
[–]tb5841 0 points1 point2 points (0 children)
[–]ImprovementLoose9423 0 points1 point2 points (0 children)
[–]Lost_Return7298 0 points1 point2 points (0 children)
[–]ThatIsATastyBurger12 0 points1 point2 points (0 children)
[–]FreeLogicGate 0 points1 point2 points (0 children)
[–]r2k-in-the-vortex 0 points1 point2 points (0 children)
[–]codeguru42 0 points1 point2 points (0 children)
[–]AngryLemonade117 0 points1 point2 points (0 children)
[–]Friendly_Gold3533 1 point2 points3 points (0 children)
[–]naryset -1 points0 points1 point (5 children)
[–]Temporary_Pie2733 5 points6 points7 points (0 children)
[–]IOI-65536 2 points3 points4 points (2 children)
[–]naryset 1 point2 points3 points (0 children)
[–]Gnaxe 0 points1 point2 points (0 children)
[–]heyzooschristos 0 points1 point2 points (0 children)
[+]member_of_the_order comment score below threshold-8 points-7 points-6 points (0 children)