Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!munnari.oz.au!metro!usage.csd.unsw.oz.au!ccadfa!ghm From: ghm@ccadfa.adfa.oz.au (Geoff Miller) Newsgroups: comp.lang.fortran Subject: Re: More Style Points -- One Entry, One Exit? Message-ID: <1814@ccadfa.adfa.oz.au> Date: 14 Aug 90 23:35:12 GMT References: <1990Aug4.011300.17395@nmt.edu> Organization: Computer Centre, University College, UNSW, ADFA, Canberra, Australia Lines: 32 nraoaoc@nmt.edu (Daniel Briggs) writes: >As long as we are discussing style points, here's one I have wondered >about. Why are people SO adamant about the ONE entry, ONE exit point >of view? Maintainability. When you have had to maintain large chunks of unstructured FORTRAN in which each (long) subroutine has multiple entry and exit points, you become slightly paranoid on the subject. Also, as I pointed out in another connection, it is better to have one simple rule to follow than to have rules which depend on the surroundings. > ...examples and discussion deleted... >.... So, style gurus, what are your opinions? Do >you stick religiously to one entry, one exit, or do you bend the rules >a bit when it makes for clearer code? Any Style Guide is an ideal. How rigidly you apply it (or have your staff apply it) is up to you, and I would be the first to admit that in some cases the very nature of FORTRAN can make stylistically pure code appear ugly. It comes back always to maintainability, and there will always be some room for judgement. Actually, the only point where I bend the one-entry-one-exit rule is in the case of an emergency stop - for example, where a program is designed to maintain two consistent data files, and yet it detects an inconsistency. In this case I stop the program with an informative (to me :-) message, because I have obviously got something drastically wrong somewhere. Geoff Miller (ghm@cc.adfa.oz.au) Computer Centre, Australian Defence Force Academy