Path: utzoo!utgpu!water!watmath!clyde!rutgers!cmcl2!brl-adm!umd5!ames!pasteur!ucbvax!decvax!decwrl!sun!pitstop!sundc!seismo!uunet!mcvax!hafro!krafla!kristjan From: kristjan@rhi.is (Kristjan Jonasson) Newsgroups: comp.lang.fortran Subject: Re: Forced variable declaration Summary: A "real" programmer has given us a red herring. Keywords: Implicit typing Message-ID: <122@krafla.rhi.is> Date: 29 Jan 88 15:56:20 GMT References: <445@drilex.UUCP> <50500018@uxe.cso.uiuc.edu> Reply-To: malcolm@keilir.IS (Malcolm Cohen) Organization: University of Iceland (RHI) Lines: 65 In article <50500018@uxe.cso.uiuc.edu> mcdonald@uxe.cso.uiuc.edu writes: [someone else had written] >>... 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 ... [is that] >you don't have to declare variables. ... >The argument about mispelled variable names is a red >herring that any REAL Fortran scientific programmer would recognize. ****FLAME ON**** Well Mr. "real Fortran scientific programmer" (I suppose you don't eat quiche either), what you have just said here is just so much rubbish that any "real" software engineer or serious programmer would recognise. Perhaps if you took more interest in Fortran language development you would have seen some things which might change your mind. **REDUCE FLAME LEVEL** In particular, you might have seen "M.A.T." (Maintainability Analysis Tool, I believe). This is a tool for analysing Fortran programs and reporting on anomalous situations (variables set but not referenced, referenced but never set, declared but never referenced or set, with the same names as those in a common block occurring in a different subprogram - you get the idea). This tool has been applied to millions of lines of Fortran code, AND IN EVERY LARGE SCALE PROGRAM IT HAS FOUND ERRORS. Moreover, MANY OF THESE WOULD HAVE BEEN DETECTED BY LACK OF IMPLICIT TYPING. You think it is easy to scan a list of variables to see what has been added/missed out eh? Obviously you have never seen/programmed/tried to fix a large (100000 lines+) program. FLAME OFF What is convenient and un-instrusive in a small program (e.g. <10 pages) turns out (not very surprisingly) to be a maintenance nightmare in larger programs. I cannot emphasise this enough: it is all very well to say "forced declaration is an unnecessary pain", but examination of the situation ***in reality*** shows that it is a NECESSARY pain (for large programs in particular). Notice that MAT did not find errors in 50% or whatever of large programs it was applied to: it found these errors IN ALL LARGE SYSTEMS!!! When the type of errors is examined, it is indeed a condemnation of the implicit typing system. ... >Errors in the mind are much more difficult to find than errors of the > fingers. I couldn't agree more. But on the other hand (as you said, computers are much better at keeping lists than people) I'd rather have the computer find at least my typing errors than find none of them at all! And when one is looking for a logic error it can be quite difficult to spot that it was a simple typing error. > >Doug McDonald, Professor of Chemistry, University of Illinois > Malcolm Cohen, "real scientific programmer", University of Iceland.