Re: Is it time to legitimise REAL*8 etc?



Paul van Delst <Paul.vanDelst@xxxxxxxx> wrote:

Richard Maine wrote:
Paul van Delst <Paul.vanDelst@xxxxxxxx> wrote:

Could someone explain to me the cumbersomeness of
SELECTED_REAL(INT)_KIND() ??

O.k., I understand what people take issue with. The interface to people's
perceptions is ass-about, but you grapple with the strangeness up front
and only once, right?

As is taught in other contexts, first impressions matter. Selecting a
real kind one of the first things you need to do in writing code. If it
is obtuse and complicated, people new to it will either get turned off
to the whole language or choose a way that is simpler, even if worse in
the long run (such as hard-wiring kind numbers).

Or, to use another saying, simple things should be simple. Declaring a
real variable shouldn't require learning about this intrinsic function,
named constants, initialization expressions (in particular, the kinds of
functions that can be used in the declaration of a named constant) and
modules - all just to write your first program that does the most
trivial thing with floating point.

I bet it wasn't the first program you ever wrote where you did your
type_kinds.f90 module. Might have been your first f90 program, but you
had to have been already moderately sophisticated to start that way.
Otherwise... well let me just say that you must not be very typical.

No, when people do their first program, they will use some other
shortcut instead. And then they will get used to that shortcut and
continue using it. Anyway, an awful lot of people will do that. Evidence
from actual people and actual codes confirms this; that's wherefrom we
get a lot of the real*8 stuff still appearing in new codes.

So provide a shortcut that doesn't require such sophistication. But make
the shortcut indeed be a subset of the more general facility so that the
user and/or program can later grow into the full thing if the need
arises. Increasing sophistication should be a matter of extending the
simple case instead of forgetting the simple case and going things
completely differently. Jumping from real*8 to the kind facility is
doing something completely diferently. Going from a system-provided
named constant to one that you define using such things as the
selected_* intrinsics is extending a simple case.

We just don't (yet) have the simple case in place. But it is pretty
evident how to make a simple case that is an actual subset of the
current kind facility; see prior discussion.

--
Richard Maine | Good judgement comes from experience;
email: last name at domain . net | experience comes from bad judgement.
domain: summertriangle | -- Mark Twain
.