[#111712] [Ruby master Feature#19322] Support spawning "private" child processes — "kjtsanaktsidis (KJ Tsanaktsidis) via ruby-core" <ruby-core@...>
SXNzdWUgIzE5MzIyIGhhcyBiZWVuIHJlcG9ydGVkIGJ5IGtqdHNhbmFrdHNpZGlzIChLSiBUc2Fu
14 messages
2023/01/07
[ruby-core:111749] [Ruby master Feature#19328] Please bring back the use of Hash objects for keyword arguments
From:
"randallcoding (Randall Coding) via ruby-core" <ruby-core@...>
Date:
2023-01-09 20:31:41 UTC
List:
ruby-core #111749
Issue #19328 has been reported by randallcoding (Randall Coding).
----------------------------------------
Feature #19328: Please bring back the use of Hash objects for keyword arguments
https://bugs.ruby-lang.org/issues/19328
* Author: randallcoding (Randall Coding)
* Status: Open
* Priority: Normal
----------------------------------------
The change in 3.0 (linked here https://www.ruby-lang.org/en/news/2019/12/12/separation-of-positional-and-keyword-arguments-in-ruby-3-0/) no longer automatically converts Hash objects into keyword arguments. This takes Ruby away from what it has always been about: being as intuitive and developer friendly as possible.
The solution given to make a hash into keywords is to perform a double splat (**) on the hash object. This is confusing and esoteric, not to mention will require a lot of old code to be re-written.
For example I have code that was written like this
``` ruby
def Foo(a:, b:)
puts a + b
end
```
which I can call by simply using
``` ruby
myhash = {a:3, b:5}
Foo(myhash)
```
Look at the clarity, simplicity and elegance. The interpreter takes care of the messy and unnecessary bits and our code is easily understandable by other humans.
But now for the same function we need to write
``` ruby
Foo(**myhash)
```
We have to add superficial extra strokes (from the human perspective) to achieve what our intelligent interpreter once knew we wanted with less hassle.
Let's not become like those other language! Please keep Ruby intuitive and developer friendly and make this feature what is was before.
--
https://bugs.ruby-lang.org/
______________________________________________
ruby-core mailing list -- [email protected]
To unsubscribe send an email to [email protected]
ruby-core info -- https://ml.ruby-lang.org/mailman3/postorius/lists/ruby-core.ml.ruby-lang.org/