5 ms·
Parentheses as pipes is what you do when you’ve backed yourself into a corner. Ruby has decided (for some reason?) to use two ways to declare. Function(param,
by tomlin 4y ago
Parentheses as pipes is what you do when you’ve backed yourself into a corner.
Ruby has decided (for some reason?) to use two ways to declare.
Function(param, param)
and
{ |param, param| }
why? What is a good reason for this?
It would be an anti pattern in design, not sure why Ruby gets a special hall pass.
- klibertp 4y agocollect: [ :keyAndValue | (keyAndValue splitAt: '=') last ]. is why. EDIT: (it's been a few months since I used it, so I) made a mistake in the syntax (declared local variable instead of a formal block argument), it's fixed now.
- tomlin 4y agoYou might as well have leaned on the keyboard, it wouldn’t look much different. This is not readable code.
- klibertp 4y ago
- tomlin 4y ago
- klibertp 4y ago
- tomlin 4y agoI don’t know Russian. Your point doesn’t line up with the topic at all. I know Ruby. I still think it’s unreadable. Can you try next time? I feel incredibly sorry for the poor kids you teach. They will be suffering aftereffects for the rest of their lives. I feel bad that your account hasn’t been flagged for your behaviour on here. For someone who thinks they understand Ruby so well, you certainly haven’t taken any time to understand the rules. Personal attacks? Really? You just showed your cards. Weak arguments are followed with weak ad hominem. It’s not just me, no one is teaching Ruby to kids because it’s not a good language for readability. Take it up with all of the teachers who see it just as I do.
- dang 4y agoPlease don't respond to a bad comment by breaking the site guidelines yourself. That only makes everything worse. https://news.ycombinator.com/newsguidelines.html https://news.ycombinator.com/newsguidelines.html
- dang 4y agoPosting like this will get you banned on HN, regardless of how right you are or feel you are. Please review the site guidelines (https://news.ycombinator.com/newsguidelines.html https://news.ycombinator.com/newsguidelines.html) and please don't post like this to HN again. This is particularly important when your argument happens to be a good one, because in that case you're discrediting the truth by posting abusively (see https://hn.algolia.com/?dateRange=all&page=0&prefix=true&sort=byDate&type=comment&query=truth%20discredit%20by:dang https://hn.algolia.com/?dateRange=all&page=0&prefix=true&sor... for past explanations of this point). That hurts everyone. It particularly hurts those of us who happen to agree with your view (me, for example—I haven't read much of this thread but I'm pretty sure I've made similar arguments about readability in the past).