I like the idea from one point of view - convenience. A bit
similar to changes such as require 'pp' being available by default;
of course it is not the same as the proposal here, since the
proposal here refers to a syntax change, whereas require 'pp'
was purely due to convenience. But from the point of view of
convenience, being able to omit "," would be nice - I actually
do sometimes forget this and then have to go to the editor
and add it, so from convenience, I like it.
Of course we can also use, at the least for Arrays, the shorthand
notations, such as %w() and so forth; then we don't need the ','.
For Hashes I believe we have no shorthand notiation, excluding
the : variant introduced some time ago; e. g. your example above
could be:
myHash = {
key: “value”,
anotherKey: “another value”
}
And it would be a bit shorter. Of course we still have to use
the ',' there.
However had I am not entirely sure if it can be so easily
added. Would this not introduce a backwards-incompatible
change? So I guess even if it were to be approved by matz
(and we don't know this as of yet), it may have to come
way past ruby 3.0.
I don't have a problem if this is not added either, though -
while it would be convenient, I don't necessarily need it
that much. We may also have to think about code that is
mixed, such as:
hash = {
abc: 'abc', def: 'def'
ghi: 'ghi',
jkl: 'jkl'
}
And perhaps other cases. (The ruby core team often needs
definitions/specifications for corner cases too, since
the implementation has to include these cases too.)
Since this is coming up every now and then, I would suggest
to mention it at some developer meeting - at the least to
hear matz' opinion about it. Because if matz does not like
the proposal then there is little point discussing it. :)
But as said, I am mostly neutral about this; only slightly
positive purely from a convenience point of view.
PS: The linked proposal is ~4 years old without much other
comments; perhaps after this may be discussed one day, we
could close down the older issues and refer to only one
of the issues, but I digress.