Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!nntp.club.cc.cmu.edu!micro-heart-of-gold.mit.edu!bloom-beacon.mit.edu!bloom-beacon.mit.edu!panix!not-for-mail From: Grant Edwards Newsgroups: comp.lang.python Subject: Re: try/except/finally Date: Tue, 10 Jun 2014 18:48:42 +0000 (UTC) Organization: PANIX Public Access Internet and UNIX, NYC Lines: 23 Message-ID: References: <0a89c96d-de62-42ad-be48-6107ce10d215@googlegroups.com> <539396F3.5090508@stoneleaf.us> <2e94b972-a630-4190-bc33-1074eb3278e3@googlegroups.com> NNTP-Posting-Host: dsl.comtrol.com X-Trace: reader1.panix.com 1402426122 3131 64.122.56.22 (10 Jun 2014 18:48:42 GMT) X-Complaints-To: abuse@panix.com NNTP-Posting-Date: Tue, 10 Jun 2014 18:48:42 +0000 (UTC) User-Agent: slrn/1.0.1 (Linux) Xref: csiph.com comp.lang.python:73114 On 2014-06-10, Mark Lawrence wrote: > I entirely agree. I find it incredible that some people find it so > difficult to differentiate having tens or even hundreds of gotos > leaping around willy nilly to a similar number of labels, and a > similar number of gotos targetted at one label called SNAFU or > whatever. I've seen some amazingly convoluted C code where people got themselves wrapped around the axle six different ways in order to avoid using "goto fail" or "goto retry". Invariably I was looking at the code because it didn't work right and needed to be fixed. Usually the addition of a 'fail' label and a few gotos allowed me to throw out all sorts of complexly nested if/else blocks, status flags, and unnecessary while loops. Usually you can reduce the number of lines of code (sometimes by half or more) while also reducing the number and nesting of control structures. And when you're done it works right! -- Grant Edwards grant.b.edwards Yow! LOOK!! Sullen at American teens wearing gmail.com MADRAS shorts and "Flock of Seagulls" HAIRCUTS!