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

Re: Python or Perl for a Debian maintainance project?



On Thu, Feb 19, 2004 at 05:58:56PM +0800, Isaac To wrote:
> Sorry that I have to express my disagreement.  A goto towards the end of a
> function, especially when the label name clearly indicates that, is
> straight-forward to read.  To somebody who get used to that sort of code,
> "goto out" would says directly that "I'm going out of this function, except
> that I have something to clean up.  Apart from that, ignore this case."  The
> "if (ok)" construct is much more complicated, and the effect depends on the
> composite effects of all the if statements.  So the "if something goto
> label" construct has a linear complexity, the complexity coming from the
> position where you place the label.  The "if (ok) next_statement" has
> exponential complexity, the complexity coming from which statement you place
> an "if (ok)" and which you don't.  I, for all purpose, would write a goto
> instead.

I'll reply once on list, if everybody yells I'll take it off list.

I'm left-handed, right-brained: visual thinker (maybe you are too), but 
I feel the opposite way you do for the same reasons!

My eye has to skip over GOTOs or it has to skip over IFs.  Same diff.

The if version is plodding and stupid, like me.  It is complex but only 
first order complexity (an asymptote).  Do one stupid dumb thing over 
and over again.  The GOTO version is elegant and clever.  I tend to 
screw clever things up.

My brain can see the pattern of the IF version and say, okay, here, 
semantically I want to know the state of the compound operation (ok), 
and here I want to know the state of the resource (the lock).

I'm dumb and stupid like the IF version.  I'm basically a really smart 
monkey.  I'll rob my grandmother if you just tell me honestly that's 
what you want me to do, without reservations.  I'm a 21st century 
plumber.

Although I can get into the other way too.  All I know is I've written 
arbitrarily complex code of the IF type because in my head 
dumb-but-plodding is complex like the integers; but clever is complex 
like the continuum.  I'm stupid.



Reply to: