Re:"Useless Ruby sugar": Endless (one-line) methods
by stouset on Saturday December 02, 2023 @01:31AM
(#38496458)
> We have several more ways to define methods already, and always have. If you think this gives us two perhaps the problem is you don't know the language very well.
Resorting to semantic-lawyering doesn’t add to your argument, it detracts from it. You know the point I was making.
Re:"Useless Ruby sugar": Endless (one-line) methods
by vidarh on Saturday December 02, 2023 @04:56AM
(#38497444)
I don't think the point you were making has any validity. It's not semantic-lawyering given that other ways of defining methods are common in larger Ruby code-bases, so you're already going to need to deal with a variety of far more complex things. If "end-less" defs is enough to throw you, then perhaps Ruby just isn't the language for you, and that's fine.
We have several more ways to define methods already, and always have. If you think this gives us two perhaps the problem is you don't know the language very well.
Choices like this, to create options to adjust how the code reads has always been central to the design of Ruby. It's an odd thing to be annoyed with Ruby over.
"Parses insanely" is highly subjective. It parses exactly as you should expect it to if familiar with Ruby. Some of it is not ideal, and will likely be addressed with adjustments to the grammar. In the meantime the simple fix is to add parentheses whenever in doubt.