Path: utzoo!utgpu!water!watmath!clyde!rutgers!iuvax!pur-ee!uiucdcs!uxc.cso.uiuc.edu!uxe.cso.uiuc.edu!mcdonald From: mcdonald@uxe.cso.uiuc.edu Newsgroups: comp.lang.fortran Subject: Re: Forced variable declaration Message-ID: <50500018@uxe.cso.uiuc.edu> Date: 24 Jan 88 17:02:00 GMT References: <445@drilex.UUCP> Lines: 46 Nf-ID: #R:drilex.UUCP:445:uxe.cso.uiuc.edu:50500018:000:2511 Nf-From: uxe.cso.uiuc.edu!mcdonald Jan 24 11:02:00 1988 >I agree. That's why it's a good idea for FORTRAN programmers to include >the line IMPLICIT LOGICAL (A-Z) or IMPLICIT CHARACTER (A-Z) in each main >program and subprogram. Even better, many compilers now make an >IMPLICIT NONE available. You must be kidding! Please, please, don't forget the smiley faces when saying things like that! The greatest feature of Fortran over languages like C or Pascal (well, C at least, Pascal has so many other stupids) is that you don't have to declare variables. One of the original goals of Fortran was to eliminate the drudge work from progamming, and variable declaration is one of the worst. Computers do a much better job of making lists than do people. The argument about mispelled variable names is a red herring that any REAL Fortran scientific programmer would recognize. An actual mistyped name is easily caught- it doesn't take any 6 hours. The computer (well, most) will give you a nice alphabetized list of variable names and all their references. Just look at it for extra names. The REAL nightmare of scientific programming, is typing a WRONG but legal variable name. Please, you computer science types, believe me. Scientific programming is my business. let's say that you are writing a program describing the vibrations of the molecule SF5 (sulfur pentafluoride). This thing has six atoms, each of which has three positions and three momenta. Fine, you number them 1 to six and use a two dimensional array. You can't declare each one separately, as you must feed the array to the integration routine. You also need all the various interatomic distances and there are 15 of these. You can't give them all different names, because then you can't use the symmetry properties in writing the potential surface. You have to use an array. You could use equivalence statements to give the array elements names, but computer science type probably would object to that. In any case, I and most of the real scientific programmers worry more about typing r(7) where we meant r(8) than typing o(8) where we meant p(8). Errors in the mind are much more difficult to find than errors of the fingers. Doug McDonald Professor of Chemistry University of Illinois P.S. In any case, even if a program is coded perfectly it may be WRONG. The fact that the whole IDEA behind a program may be wrong is something that computer types frequently forget. If I design my program assuming that F = MA instead of H* Psi = E * Psi it's going to give a "wrong" answer!