Pierre Hugonnet <[log in to unmask]> wrote:
...
>At least, while talking about pointers we don't do science... :-)
>
>
>To be more serious, this discussion points out that f90 introduced
>some comlexity where it was not necessary: it is incredible that
>we have to deal with such considerations which are far from
>intuitive: is this pointer associated, disassociated, undefined?
>what happens if I associate a pointer to an undefined pointer?
>Can I nullify a undefined pointer?
>After deallocation is the memory really released?...
>
>Where is the simplicity of f77? the main constraint to build f90
>should have been to keep a simple langage: as an exemple, a modern
>scientific programming langage should not introduce any feature
>which potentially leads to memory leakage! I consider that the
>care taken by the fortran programmer to check for it is
>*a waste of time*.
...
I have always held this opinion. In most of the work done throughout
the '80s on Fortran (then called 8x) there was no pointer feature in
the proposals. Pointers were introduced as a result of the meltdown
after the very unfavorable public response. Most of the activity in
that period was rushed and much was not very well thought out.
Pointers were actually supposed to be a simplification. Mechanisms
such as ALIAS/IDENTIFY and RANGE were considered too complex
(though easier to implement and never causing memory leaks or orphaned
pointers). Further, people wanted some support for recursive data structures
(I was one of those, and I still kick myself for that poor choice). Pointers
were considered the simplest way to allow such things as lists, trees, etc..
If Fortran were to allow allocatable variables to be reallocated,
allow ALLOCATABLE as an attribute of dummy arguments, and
allow allocatable fields within derived data types, I suspect I'd never
use pointers at all. I no longer consider recursive data structures as
sufficient reason to spoil the language with pointers (especially since
all could be emulated efficiently with reallocatable arrays).
This whole thread demonstrates what I've always maintained: pointers
intoduce unnecessary complexity into a language and unnecessary
difficulties into a program. You should only use pointers when aliasing
is really an intentional part of what you're trying to do - and that should
be very rare.
--
J. Giles
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|