[J3] Why is += missing?
Ondřej Čertík
ondrej at certik.us
Wed Sep 1 21:18:12 UTC 2021
Hi Malcolm,
On Wed, Sep 1, 2021, at 2:29 AM, Malcolm Cohen via J3 wrote:
> >> It bloats the language with extra (and un-Fortran-like) syntax. There is a cognitive load associated with the size of a language.
> >
> >The cost to users of unused language features is zero.
>
> That is just not true, unless by “unused” you mean “unused by everyone
> including the textbooks”.
>
> > make the cognitive load of Fortran so high as to harm the community
>
> Not by itself, of course not. But every straw adds to the camel’s back.
I actually agree with this line of thinking, and that is the reason why I often vote NO on proposals. Here is a thread that I started named "Cost of adding (any) new feature to the Fortran language" where I list about 10 possible costs:
https://fortran-lang.discourse.group/t/cost-of-adding-any-new-feature-to-the-fortran-language/1479
However, we should apply this exact reasoning to all proposals, not just selectively.
For example the new ? operator. Given that you are against += (since the extra straw would add to the camel's back, and I agree), but you are for ? (meaning that it would not yet break the camel), it means that we can add one such proposal to Fortran, but perhaps not two. Ok. So if we have to choose between ? and +=, I would personally choose += over ?.
Others might disagree and prefer ? over +=. However, one of the costs of a new feature, in this case ?, is that it might prevent us to put a better feature later, in this case it seems ? is preventing us to put +=, because every straw adds to the camel’s back.
Given the number of lines that could use +=, it seems the number of lines that could use ? is orders of magnitude less, or is that not the case?
> > Are you actually going to assert that a substantial fraction Fortran programmers are familiar with so few other common program languages
>
> Yes, for one thing there are many people programming who are not
> professional programmers. Some of those know both C and Fortran, some
> may know C but not Fortran, and some Fortran but not C.
The new ? operator is exactly like in C. As a committee we have decided that was the best approach from all the alternatives. So we can as well add the += operator, because we already assume Fortran users will be able to understand the ? operator, and I argue that += is a lot easier to understand than ?.
I would encourage us to be open minded about adding +=.
Ondrej
More information about the J3
mailing list