Re:What's better about Ruby than Python? - comp.lang.python
by mcantor on Friday August 27, 2010 @09:37AM
(#1638761)
Interesting! I am a half-breed; I write Python at my day job and Ruby in my personal projects. You seem to be suggesting that I am sort of making a mountain out of a molehill. Can you perhaps elaborate on this? I have definitely felt this pain before; I'm not just complaining about it because I "like the Python way more." But if I'm not using Ruby "as intended," I would like to know how I should be using it instead! I feel like the "Python way" is powerful because you don't have to think about whether you're dealing with an anonymous function or a function, whereas in Ruby you must know for sure which one you are dealing with, because they are invoked differently. I'm interested to know how it isn't really a problem, if that's how you feel.
[ Parent
| on HN ]
Re:What's better about Ruby than Python? - comp.lang.python
by carbon8 on Friday August 27, 2010 @11:32AM
(#1639076)
It's not a problem in Ruby because you don't pass around method instances, you pass around Procs (wrapped blocks, lambdas and procs), so if you are passing a callable around, you know it's a Proc. If you are passing around a method instance, you should almost certainly be using a block, lambda or proc.
Also, see wycats post: http://yehudakatz.com/2010/02/21/ruby-is-not-a-callable-orie...
Re:What's better about Ruby than Python? - comp.lang.python
by yxhuvud on Saturday August 28, 2010 @06:35AM
(#1641570)
If you have a method that in python would take a function as a parameter then it usually will be passed as a block in ruby.
This doesn't really work if you would want to pass several procs into a method, but honestly, that is not very common.