3 ms·
"Reflection a.k.a Meta Programming a.k.a Monkey Patching" Really? These are all the same thing? I think not. "Python comes with webbrowser, urllib2, smtp, htt
by jamesbritt 17y ago
"Reflection a.k.a Meta Programming a.k.a Monkey Patching"
Really? These are all the same thing? I think not.
"Python comes with webbrowser, urllib2, smtp, http, SocketServer, HttpServer, and more, while Ruby only has net/HTTP"
Untrue. Seems the author knows Python, and spent a little time with Ruby.
More useful points to make would have been how objects are implemented, how inheritance and mixins are handled, and the key paradigms in the language (e.g., in Python, foo.bar() means invoking the method bar; in Ruby, it means sending foo a bar message.)
- dkersten 17y agoAgreed. Reflection != metaprogramming != monkey patching. They are loosely related, but FAR from being the same thing.
- didip 17y agoThat is correct, they are not the same thing. That statement is coming from my use case, where I, have so far, only use them for manipulating objects during run time. Be it calling function, setting attributes, or adding extra functionality by including modules.
- jamesbritt 17y ago"That is correct, they are not the same thing. That statement is coming from my use case, where I, have so far, only use them for manipulating objects during run time." So here's my main complaint: If you know that these things are not really the same, why do you present them as if they were? You would have had a much more favorable reaction had you been more upfront on your biases, limited Ruby experience, and narrow focus for comparison.
- didip 17y agoBecause in my eyes, they all serve this purpose: "That means you have access to the inner working of an object." Whichever technique I choose to use does not matter. I am using my blog the way blog is intended to be used, as opinion piece, I had no attempt in hiding my biases, but there's no need to purposely be biased as well because I like both and make a living out of both.