From chemistry-request@ccl.net Mon Dec 9 17:41:13 1991 Date: Mon, 9 Dec 1991 17:24 EST From: Dale Southard Subject: Re: FORTRAN vs C To: chemistry@ccl.net Status: R >> From: Dale Southard >> Fortran programs have a tendency to degenerate into jumbles of spaghetti >> code. Fortran itself does not encourage the creation of structured, modular >> code (some would go so far as to say that it actively discourages it)... >From: IN%"shenkin@avogadro.barnard.columbia.edu" >I actually wonder how much of this is in the language itself (Fortran or C), >and how much is in the culture built up around the language. C does have >more structured features than Fortran, it is true, but very nicely structured >code can also be written in Fortran-77, especially if you accept the INCLUDE >extension. The C bible is Kernighan and Ritchie, and their code is >beautifully structured, indented, etc. C maniacs may fight over alternative >indentation styles, but in Fortran there's more of an argument whether >to indent or not in the first place! This is only a matter of culture >(or the lack thereof). :-) Indentation styles, though making structure easier to recognize, do NOT create structure in C. C is a wealky typed, free-form language. C code is structured no matter how it is organized/indented. Fortran is usually not structured. Structured refers to modularity of programming. In simple terms: Structured code uses functions/subroutines. Spagetti code uses the goto statement or its equilvent. To see the difference, try creating a post-test loop in fortran without a goto statement. You can't. In C it is trivial. Of course it is possible to write unstructured code in C, but it is REALLY HARD. Writing unstructured code in fortran is simple. So simple that modifications to pre-existing fortran code tend to be entropy driven (producing spagetti code). But a more interesting question: Does anyone actually have a f90 complier? I haven't seen anyone with one of these mythical beasts yet. It is getting close to '92. If fortran90 is everything it is being touted as, I would hate to see it go the way of fortran8x (i believe that the x=8 but I wasn't too involved in fortran at the time). Will f90 make the jump from ANSI standard to installed standard? Dale U of Toledo