Re:"Useless Ruby sugar": Endless (one-line) methods
by ysavir on Friday December 01, 2023 @01:17PM
(#38490171)
This is my reaction as well. I like the idea of collapsing a simple method into a single line, but the `=` makes it such a weird thing to actually parse. I wonder what prevented them with using a proc-like braces syntax, which would be intuitive for those familiar with the language (and the `def` to set it apart from procs)
[ Parent
| on HN ]
Re:"Useless Ruby sugar": Endless (one-line) methods
by vidarh on Saturday December 02, 2023 @04:59AM
(#38497454)
{} is already overloaded for both blocks and Hash literals, both of which commonly occur at the end of the argument lists. It seems like it'd create far more opportunities for making the code hard to read.