On 2014-06-10, Mark Lawrence <breamore...@yahoo.co.uk> 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!

Reply via email to