[comp.lang.misc] Forced variable declaration

carols@drilex.UUCP (Carol Springs) (01/23/88)

In article <2666@mmintl.UUCP> franka@mmintl.UUCP (Frank Adams) writes:

>What I really hate is having the compiler *not* yell at me for mispelling
>one of my variable names, and having to spend (sometimes) hours to find the
>bug.  The overlooked declaration can be fixed in a few minutes.  It takes a
>*lot* of those to make up for one six hour debugging effort.

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.  

I realize that the thought of being forced to declare one's variables is
odious to most "traditional" FORTRAN programmers.  I still remember students  
from my T.A. days who would look at me as though I were off my rocker for  
telling them to use IMPLICIT LOGICAL and declare all their variables.  These
kids' major, unsolvable problems always seemed to stem from some overlooked
misspelling.  Of course, in the professional world, such things never 
happen.  ;-)  

-- 
      Carol Springs           "Programmers are allowed five extra years." 
Data Resources/McGraw-Hill   {rutgers!ll-xn, ames!ll-xn, mit-eddie!ll-xn, 
    24 Hartwell Avenue           husc6!harvard, gatech!harvard,  
   Lexington, MA  02173          linus!axiom, necntc}     !drilex!carols