A really real algorithmic win?



Is "A real win" a real win for algorithm ?
If you need to break a loop, you'd better think on a better algorithm. Breaking the instruction flow is very confusing.
I would not recommend to beginners to use the break instruction, it would give very bad habits.

Is there some warning on the use of break and goto-like instruction ?

for anyloop:
    break   # that is evil !

better use something like:

while continue_loop == True:
    # instructions
    if some_condition == True:    # ok, no need to loop any more
        continue_loop = False


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.