Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!mephisto!udel!nigel.ee.udel.edu!mccalpin From: mccalpin@perelandra.cms.udel.edu (John D. McCalpin) Newsgroups: comp.lang.fortran Subject: Re: Fortran 77 Style Guide (long, REPOST) Message-ID: Date: 3 Aug 90 11:37:38 GMT References: <26B89BE1.4349@ics.uci.edu> <59012@lanl.gov> Sender: usenet@ee.udel.edu Organization: College of Marine Studies, U. Del. Lines: 32 Nntp-Posting-Host: perelandra.cms.udel.edu In-reply-to: jlg@lanl.gov's message of 3 Aug 90 02:07:18 GMT In article <59012@lanl.gov> jlg@lanl.gov (Jim Giles) writes: > > [...(quoting David Levine's style guide) ...] > >> 1) Use PARAMETERs to symbolically name all compile-time constants. > > A little to rigid. If the constant is something that's likely to > change in future versions of the code, name it. If the constant > is hard to remember (or long and prone to typing errors), then name > it. Otherwise don't name it. I've seen people who've named 1 (one), > and then used that everywhere - this doesn't enhance legibility or > maintainability at all. There is not much need to declare a parameter for integer 1, but there is an advantage in declaring parameters for fractional floating-point numbers, since the precision can then be changed by an IMPLICIT statement rather than searching/replacing through the whole code. Unfortunately, X3J3 seems to have ignored my requests that something intelligent be done about this in Fortran-90.... An another subject, the spacing and capitalization rules can (almost) all be handled by the TOOLPACK utility 'pol'. The only thing that I can think of that it cannot do is capitalize the first letter of each word in identifiers which are not keywords or variables (I guess that means subroutine and function names). TOOLPACK currently limits the user to 6-character identifiers, but also provides an interactive naming facility. I don't know if it would be difficult to hack 31-character names into the code.... -- John D. McCalpin mccalpin@perelandra.cms.udel.edu Assistant Professor mccalpin@vax1.udel.edu College of Marine Studies, U. Del. J.MCCALPIN/OMNET