Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!ut-emx!jwe From: jwe@che.utexas.edu (John W. Eaton) Newsgroups: comp.lang.fortran Subject: Re: Decent FORTRAN books? Message-ID: <50082@ut-emx.uucp> Date: 6 Jun 91 05:02:37 GMT References: <1991Jun5.161838.4436@cunixf.cc.columbia.edu> <1991Jun6.031122.27876@jato.jpl.nasa.gov> Sender: news@ut-emx.uucp Reply-To: jwe@andy.che.utexas.edu (John W. Eaton) Organization: University of Texas at Austin Lines: 47 In article <1991Jun5.161838.4436@cunixf.cc.columbia.edu> shenkin@cunixf.cc.columbia.edu (Peter S. Shenkin) writes: >> Metcalf, "Effective Fortran 77", Oxford U. Press, is excellent. >> >> My main problem with it is a poor index; you pretty much have to >> read the whole book to know where to find something. Yes, but the book is pretty short so it's not terribly difficult to read the entire thing carefully. In article <1991Jun6.031122.27876@jato.jpl.nasa.gov> mwette@csi.jpl.nasa.gov (Matt Wette) prefers: > "Fortran 77," by Harry Katzan, Jr., Van Nostrand Reinhold Company, 1978 > > No style hints. Fortran 77, and all of it, with a few example > fragments to give you the idea. This sounds very much like Metcalf without style hints. I agree that too many style tips are not terribly desirable, but is it really that bad to be told that excessive use of computed goto statements is generally considered ugly and hard to maintain? > Too many Fortran programming books omit the obscure parts of the > language. How many readers know that the following is legal and > know what it is used for? > > SUBROUTINE XYZ(I, *, *, *) > > This is covered in [Katzan]. It is also covered by Metcalf. He also points out that Excessive use of the alternate RETURN feature can lead to a messy logic flow between subprograms. Its use should be reserved for exception handling... Unfortunately, he doesn't point out that the same effect can be achieved (in a clearer way, IMHO :-) by simply using a single extra integer parameter, say ERROR, and setting its value before returning. -- John W. Eaton | If the odds are a million to one jwe@che.utexas.edu | against something occurring, chances Department of Chemical Engineering | are 50-50 it will. The University of Texas at Austin | -- fortune(1)