Path: utzoo!mnetor!uunet!husc6!cca!g-rh From: g-rh@cca.CCA.COM (Richard Harter) Newsgroups: comp.lang.c Subject: Re: Another "D" idea (Oh no, not again!) Message-ID: <25743@cca.CCA.COM> Date: 19 Mar 88 18:24:32 GMT References: <1170@ucsfcca.ucsf.edu> <316@wsccs.UUCP> Reply-To: g-rh@CCA.CCA.COM.UUCP (Richard Harter) Organization: Computer Corp. of America, Cambridge, MA Lines: 27 Summary: Break n probably not a good idea. In article <316@wsccs.UUCP> val@wsccs.UUCP (Val Kartchner) writes: ... suggesting a break n construct to escape n levels up. Some languages have this. It doesn't really work very well. The problem is that it is a maintenance nightmare. If you have deeply nested code (and that is where this thing would be used) and you change an intermediate level of nesting you also have to change all of those lower level 'break n's. Moreover it can be, shall we say, obscure as to where that 'break 5' is returning control to. I am inclined to believe that labelled escapes are somewhat better. We have already gone over this one, and several people with large clubs have convinced me that it is not worth bothering with. The situation boils down to this: There is no good way in block structure code to deal with multi-level escapes. It appears to be a fundamental property of block structured code. There is only one real cure: Don't write deeply nested code that needs multi-level escapes. -- In the fields of Hell where the grass grows high Are the graves of dreams allowed to die. Richard Harter, SMDS Inc.