I'll give you credit for one thing: you did provide an excellent example of a _very_ poor argument. I'll add it to PascalDragon's which was in the same class.
Gets a bit complex here.
1) There may be a partial misunderstanding between what I read from your text, and what you may have tried to express.
Based on that, naturally the quality of my statement will be poor, if measured against your intended expressed content. After all my statement was not made to be compared with that.
2a) I should not have dismissed your text as argument (for how I read it, see below), but rather as "argument pro the initial feature request"
2b) When referring to my argument it should be clear that my argument is about the relation between your argument (as understood by me) and the initial feature.
I stress out again, that I do not / did not argue against the original feature request (nor do I argue for it)But, it isn't a simple matter of more typing. I am not against lots of typing, I like COBOL for instance and, nothing beats COBOL when it comes to typing a lot.
Sorry, entirely misunderstood you on that part.
The problem with the construction above, is all the duplication. Duplication is very undesirable because every duplicate has to be verified for consistency instead of having a single value to verify.
Absolutely +1
But that was not part of the conversation.
This is an entirely new argument. I replied to
https://forum.lazarus.freepascal.org/index.php/topic,49505.msg359465.html#msg359465 (2nd paragraph, see end of this post)
And in that text of yours I can not find any reference to reducing duplication.
So again: Not part of the issue that I was talking about. Not part of the text I replied too.
Off topic: I do however grant you: De-duplication is a good argument for the initial feature request.
There is nothing preventing initializing one of the variables with OTHER_INIT_VAL instead of NAMED_INIT_VAL, while it is very _unlikely_ that an entire group of variables is going to be initialized to the wrong value.
And if you have 2 groups of variables, both initialized with 0, nothing stops the programmer from putting ONE variable into the wrong group
var
a, b, d: integer = 0; // c should be in here, but its easy to put it into the wrong line. Even more easy if code completion is used, and the " = 0" added later.
m, c, n, o, p: integer = 0;
In terms of grouping mistakes, this has similar potential of errors.
About the argument to which you replied.
Which is my argument at
https://forum.lazarus.freepascal.org/index.php/topic,49505.msg359472.html#msg359472Which was in reply to:
Honestly, it is a bit silly to require the programmer to have individual declarations for every variable when each variable is supposed to have the same initial value. As should be obvious, the separate declarations give no indication that the group of variables _should_ have the same initial value.
I underlined the part to which I responded.
You talk about variable belonging to a group, and more that the group intentionally has one initial value that applies to all its members.
var a, b, c, m, n, o: integer = 0;
Does not convey this intention.
The variable could well be together in that line because some author actually wanted to save on typing.
Your intention could be reached by writing
const
FOOVAL = 0;
BARVAL = 0;
var
a, b, c: integer = FOOVAL;
m,
n,
o: integer = BARVAL;
However, this is the point were my argument stands.
Within the current language (that does not have the above shorthand, and that does require the duplication) each variable needs to be initialized on its own.
Using a constant, it is possible to express the
same intend of one shared initial value. (The example that I posted)
De-duplication (albeit a very good point) was not in your original text. It was not part of me responding to your text.
De-duplication <> expressed shared initial value
Those two are separate issues.
You may say (and I would believe you that it may apply to you) that once "expressed shared initial value" is reached (e.g. by using a constant) adding de-duplication on top makes it easier to see the "expressed shared initial value".
I would answer to that, that the added readability may (at least to a big part) derive from the source formatting that changed with the syntax. And read-able source formatting can be reached with existing syntax to.
There may remain a real tiny amount of higher recognition of "expressed shared initial value" due to readability changes caused by de-duplicaten.
Note the last sentence does not downplay the effect of readability offered by de-duplication. It merely makes a statement to which part this read-ability affects the "expressed shared initial value" compared to other form of source formatting that could underline the "expressed shared initial value".
I already expressed that I share your view on de-duplication being a good thing.