[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Python or Perl for a Debian maintainance project?

On Fri, Feb 20, 2004 at 09:25:58AM +0800, Isaac To wrote:
>     Philip> ... (Do-while/break trick skipped)
> Under the nice-looking surface, I think the code is somewhat too dangerous:
> if you suddenly have to do some of the statements there more than once and
> add a while-loop around them, the break statement suddenly changes the
> semantics to break the while loop instead of the do loop

Yes, quite so. In that sort of situation, when you have that much
complexity, you should transform the thing into a separate function.

And isnt it cool that you can then lift the code almost verbatum, instead
of worrying about "gee, now how do I get all my 'gotos' recoded?...."


As a side note, you should always look thrice at any "break" statement
that is at more than two levels of indent.

(which is effectively "more than ONE level", since the first level is the
 standard function indent)

Reply to: