Re: Goto considered dramafull
Frank Trampe <[email protected]>
| Newsgroups | gmane.comp.fonts.fontforge.devel |
|---|---|
| Message-ID | <CANkSbhpqxnVYZkNDBdO9JPWZ9a4T-nFm6ruV0UVCZfXVQ8wPDA@mail.gmail.com> |
I've never liked gotos because they break the nesting model and make tiered clean-up difficult. There are plenty of ways to avoid using them. One is to have each block check for success or non-failure of the preceding block before doing its thing. This also allows for more localized clean-up of block-specific data. On Sat, Aug 30, 2014 at 1:06 AM, Thomas Shinnick <[email protected]> wrote: > I do not wish to start any drama nor religious wars. I'm just struck by > the number of places in python.c where the same cleanup-on-error stanzas of > free()s / DECREF's and other code occur a number of times in one routine. > It makes one nervous whether they all are *correctly* duplicated. > > One accepted answer is just to repeat each group of lines ad nauseum, as > needed, even if needed 6 times in one routine. (!) > > Another answer is to consolidate into one stanza reached by multiple > goto's. All necessary free()s/DECREF's/etc. collected together. But > that's "goto", consider by some worse than GMO brocolli. > > As a data point, I find "goto" used a number of times in FF already: > mainline 155 > gdraw 11 > gutils 74 > as well as in of course GNUlib and other friends. > > Y'all have an absolute aversion to "goto" ? > > > ------------------------------------------------------------------------------ > Slashdot TV. > Video for Nerds. Stuff that matters. > http://tv.slashdot.org/ > _______________________________________________ > fontforge-devel mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/fontforge-devel > http://fontforge.10959.n7.nabble.com/Developer-f3.html > > ------------------------------------------------------------------------------ Slashdot TV. Video for Nerds. Stuff that matters. http://tv.slashdot.org/ _______________________________________________ fontforge-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/fontforge-devel http://fontforge.10959.n7.nabble.com/Developer-f3.html