4 ms·
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
by sodapopcan 5y ago
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.
- sodapopcan 5y agoMy bad, the example illustrates in a function head. So how are require keyword args going to work now?
- sodapopcan 5y agoOh wait, it's function definition vs callsite (duh). This is still unnecessary confusion.