On 28 September 2017 at 06:56, Bill <bill_nos...@whoknows.net> wrote: > Steve D'Aprano wrote: >> >> >> Similarly for break and continue. >> >>> I can still see their >>> use causing potential trouble in (really-long) real-world code. >> >> How so? >> >> Besides, if your code is "really long", you probably should factorise it >> into >> smaller, meaningful chunks. >> > > I worked in maintenance programming. You got the hand you were dealt! And > you weren't allowed to "improve" the code unless the customer contracted you > to do so. I maintained for-loops (containing for-loops)... hundreds of > lines long. Would you be searching for break or > continue? : )
I also work in maintenance. Agreed 100% that the sort of code you deal with is a nightmare. But the problem with that code is *not* break/continue, but the lack of structure and the fact that the code isn't properly broken into meaningful subunits. I'd rather not search for break/continue in such code, sure, but that's missing the point entirely. "Don't use break/continue in appallingly bad code" doesn't generalise to "don't use break/continue", but rather to "don't write appallingly bad code" :-) Paul -- https://mail.python.org/mailman/listinfo/python-list