PythOnRails@programming.dev to Programming@programming.dev · 1 year ago"Useless syntax sugar": Numbered block parameters in Rubyzverok.spaceexternal-linkmessage-square22fedilinkarrow-up141arrow-down13cross-posted to: hackernews@derp.foo
arrow-up138arrow-down1external-link"Useless syntax sugar": Numbered block parameters in Rubyzverok.spacePythOnRails@programming.dev to Programming@programming.dev · 1 year agomessage-square22fedilinkcross-posted to: hackernews@derp.foo
minus-squareexussum@lemmy.worldlinkfedilinkarrow-up1·1 year agoIn what way? If you encountered a function that had x and y which just added them together, that’s not readable enough?
minus-squareMiaoulinkfedilinkarrow-up1·1 year agoWell in a vacuum yes sure, you’re right, but in practice there’s always some context. x and y could be referring to axes, where an addition makes little sense. However lhs and rhs make more sense if you’re overloading an operator
Lhs and rhs are much better than x and y
In what way? If you encountered a function that had x and y which just added them together, that’s not readable enough?
Well in a vacuum yes sure, you’re right, but in practice there’s always some context. x and y could be referring to axes, where an addition makes little sense. However lhs and rhs make more sense if you’re overloading an operator