Dear comp-fortran90 Readers,
On Wed, 3 Dec 1997, Alberto Fasso' wrote:
> On Thu, 4 Dec 1997, Len Makin, CSIRO Maths & Info Sci, Melbourne. wrote:
>
> > I fully agree. It's a bit like IMPLICIT NONE. When giving courses on F90,
> > I recommend both
> > - every program unit contains IMPLICIT NONE
> > - every module starts with PRIVATE
> > as a convention/programming style. Pity these two are not defaults.
> > I'd like to be able to say "Not just a good idea - it's the LAW!" ;-)
>
> Let me disagree with this widespread point of view.
> Fortran is great because it leaves you freedom. If you want to program
> safely, nobody can stop you; but I like to be left the choice to myself.
> Not everybody writes huge programs all the time: I am using Fortran
> every day, but most of the time to write small programs (I use it very
> often instead of a pocket calculator or of a shell script). In these
> cases I am not willing to waste my time declaring all variables,
> including the index of the do-loop which sometimes constitutes my whole
> program.
> The implicit type convention is extremely useful for this kind of "scrap
> paper" calculations. When I have to write a "serious" program then
> things are different, and I take seriously IMPLICIT NONE, indentation,
> comments, etc. But please, forget unnecessary constraints and especially
> the LAWs: we are all adults, not schoolchildren.
>
> A. Fasso'
> --------------------------------------------------
> Stanford Linear Accelerator Center
> Radiation Physics Dept. ms 48, P.O. Box 4349
> Stanford CA 94309 (USA)
I don't want to start a holy war on this but I disagree with the the
last bits. Sure Fortran's conventions regarding integer and real scalars
(and it is only these!) are convenient for small programmes. But does
this justify the exception? It is an unneccessary exception from today's
point of view. A beginner should not have to learn it. It undermines
good programming habits which are hardly encouraged in Fortran anyway.
The above rules are recommended in nearly every new Fortran textbook.
So it is even more lamentable when the Fortran standard committee adds
new features but still takes a relaxed attitude towards good programming
habits (and good language design though F90 is much improved).
The PUBLIC vs PRIVATE default in MODULEs is such a case.
An IMPLICIT FORTRAN77 could have been an option with IMPLICIT NONE the
default in new(!) F90 codes incl MODULEs.
Sure nobody can prevent(!) me from programming safely in Fortran. But I
consider to have these kinds of safety constraints to be a relief
rather than a burden.
Yours sincerely,
WWS
-----------------------------------------------------------------------
| Werner W Schulz |
| Dept of Chemistry email: [log in to unmask] |
| University of Cambridge Phone: (+44) (0)1223 336 502 |
| Lensfield Road Secretary: 1223 336 338 |
| Cambridge CB2 1EW Fax: 1223 336 536 |
| United Kingdom WWW: |
-----------------------------------------------------------------------
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|