From: Trans Date: 2007-01-04T15:42:31+09:00 Subject: Re: Little Things Rob Sanheim wrote: > How is this better then having send and the __send alias, along with > the corresponding bang methods? It seems to me having one method that > means "send a message", and then having one version be the "dangerous" > version is much more obvious then having object_send and > instance_send. I just explained that. I'm sorry but I don't understand how is is not clear. I guess all I can do is try to sum up on a bullet point basis: 1) you have 4 methods when only 2 are needed 2) and two of those methods are ugly shadow methods 3) #send is common enough a word as to be too easily over-ridden 4) using #__send to circumvent this makes #send completely pointless > If a ruby newbie tried "send" and saw it fail due to a private method, > I bet once they saw "send!" in the docs or in irb they would > immediately know how it works. Its aligns perfectly with many other > things in the std lib, and fits perfectly with POLS. not really since 90+% of the time "!" means in place change. personally i could care less about the !, to me that's not really the point -- there's a more fundamental issue here. To me POLS is 1) methods starting with 'object_' or 'instance_' are Vital methods and should not be overridden (unless you know exactly what the heck it is you're doing) 2) methods starting with 'instance_' provide Internal access to the receiver. > As for protecting from people overriding it, I think having the > underscore forms is enough. YSYEO ("You'll shoot your eye out.") I'm > sure there are programs were object_id and other meta-methods are > overridden. All you can do is warn people against doing it, test your > code, and of course choose libraries that behave well. There was a reason #id was changed to #object_id. T.