Path: utzoo!mnetor!uunet!lll-winken!lll-lcc!pyramid!fmsrl7!metavax!chris From: chris@metavax.UUCP ( PSA) Newsgroups: comp.lang.fortran Subject: Re: Forced variable declaration Message-ID: <2846@metavax.UUCP> Date: 29 Jan 88 20:49:17 GMT References: <445@drilex.UUCP> <50500018@uxe.cso.uiuc.edu> Reply-To: chris@metavax.UUCP (Chris Collins) Organization: Meta Systems, Ltd. -- Ann Arbor, MI Lines: 51 In article <50500018@uxe.cso.uiuc.edu> mcdonald@uxe.cso.uiuc.edu writes: > >>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! > >Doug McDonald >Professor of Chemistry >University of Illinois > I am so, so, SO glad that smiley faces were NOT added on such a correct and _necessary_ statement. For the past 5 years or so, I have had the inglorious task of maintaining around 200,000 lines of Fortran which was written without the required declaration of variables. The failure of a variable to be declared was responsible for at least 30% of the errors which I corrected. It was only recently that I was able to make use of IMPLICIT to avoid these problems en masse in our recent new version of our software. Secondly, it is my experience that once software is completed, if in testing it appears to be working, cross reference listings generated by the compiler are ignored. Thus an apparently correct output would indeed be accepted by end users as correct. This type of error is particularly painful if some users come to depend upon the incorrectness and then it is removed (This happened to us, and those who depended on the error lost money because of it). It is my firm belief that the only reason that Fortran does not require variable declaration is that the original developers were developing one of the first compiled languages, and thus _didn't know any better_. There was no experience in the use of higher level programming languages to be had. Thirdly, the example Professor McDonald sites from his application does not show that variables shouldn't be declared, only that they should be declared correctly for the application involved. ------ /MM/\MM\ META SYSTEMS, LTD. /MM/ \MM\ 315 E. Eisenhower /MM/ /\ \MM\ Suite 200 === == === Ann Arbor, MI 48108 \SS\ \/ /SS/ \SS\ /SS/ Chris Collins, Senior Programmer \SS\/SS/ ------