On Tue, Feb 17, 2004 at 09:18:15PM +0100, Oliver Kurth wrote:
> On Tue, 2004-02-17 at 17:58, Andrew Suffield wrote:
> > On Mon, Feb 16, 2004 at 03:06:33PM +0000, Will Newton wrote:
> > > On Monday 16 Feb 2004 1:47 pm, Andrew Suffield wrote:
>
> > > In C you have:
> > >
> > > void shoe()
> > > {
> > > /* Do some complicated stuff */
> > > if (foo == NULL)
> > > goto cleanup;
> > > /* Continue complicated stuff */
> > > if (bar == 3)
> > > goto cleanup;
> > >
> > > cleanup:
> > > /* Cleanup */
> > > }
> >
> > Good grief, that's *terrible* C. Don't do things like that. The
> > problem here is not a lack of exceptions, it's just bad code. As
> > usual.
>
> This practice is used very exensively in the linux kernel code, and in
> most cases it is very convenient, and easy to read. As long as you use
> gotos just for exceptions, it is okay. In all other cases I agree, it is
> a big fat DON'T.
This is delusional. It's quite unnecessary here and makes the code
messier; that was the point of my previous mail, where I sketched out
one alternative approach. It's the sort of thing done by somebody who
has exceptions on the brain, rather than just thinking about what the
code should be doing.
--
.''`. ** Debian GNU/Linux ** | Andrew Suffield
: :' : http://www.debian.org/ |
`. `' |
`- -><- |
Attachment:
signature.asc
Description: Digital signature