News for hackers. Stuff that matters.
Re:Ruby 3.1.0 Preview 1 by sodapopcan on Tuesday November 09, 2021 @12:02PM (#29164229)
While yes, parameter names are usually longer than 1 character, I'm super disappointed that Ruby has introduced this. I hate hate HATE this in JS. Sure, it's easier to write, but my brain always has to do a small double-take as to what I'm looking at while reading as it looks almost identical to destructuring.

Also, how is this going to work in function heads? `def foo(bar:)` means that `bar` is a required keyword. Is it going to have to be `def foo({bar:})`? In that case, it's going to come off as a potential style error to many people.

Re:Ruby 3.1.0 Preview 1 by sodapopcan on Tuesday November 09, 2021 @12:04PM (#29164265)
My bad, the example illustrates in a function head. So how are require keyword args going to work now?
Re:Ruby 3.1.0 Preview 1 by sodapopcan on Tuesday November 09, 2021 @12:16PM (#29164387)
Oh wait, it's function definition vs callsite (duh). This is still unnecessary confusion.