Path: utzoo!attcan!uunet!clyde.concordia.ca!news-server.csri.toronto.edu!rutgers!aramis.rutgers.edu!paul.rutgers.edu!emuleomo From: emuleomo@paul.rutgers.edu (Emuleomo) Newsgroups: comp.lang.c Subject: Re: if (e1) return e2; [else] s1; Message-ID: Date: 28 Mar 90 16:59:20 GMT References: <887@dino.cs.iastate.edu> <10624@alice.UUCP> Organization: Rutgers Univ., New Brunswick, N.J. Lines: 44 In article <10624@alice.UUCP>, ark@alice.UUCP (Andrew Koenig) writes: > Some people take the view that except at the end of a function, > `return' is just a funny way of spelling `goto.' > -- > --Andrew Koenig > ark@europa.att.com Yeah, but this can be really beneficial if used properly. Consider main() { if () return(FAILURE); a +=b; etc... etc... etc... return(SUCCESS); } AND main() { if () status_code = FAILURE; else { a +=b; etc... etc... etc... status_code = SUCCESS; } return(status_code); } Somehow, I think the former is becomes easier to comprehend as the size of the code "inside" the else clause get larger. --Emuleomo O.O. (emuleomo@yes.rutgers.edu) -- *Nothing* is hard. If it looks hard, you are looking at it the hard way!