shokai / websocket-client-simple

Simple WebSocket Client on Ruby
https://rubygems.org/gems/websocket-client-simple
MIT License
115 stars 68 forks source link

Proposal: Don't override Ruby's core method #19

Closed eagletmt closed 7 years ago

eagletmt commented 8 years ago

Rename Client#send to Client#send_data

abrandoned commented 8 years ago

:+1:

shokai commented 7 years ago

Object#send (used for metaprogramming) can do the same for Object#__ send__. So I think overwriting send is no problem.

eagletmt commented 7 years ago

I know Object#__send__, but most Ruby programmers and libraries expect #send acts like #__send__. I think any methods should not be overridden unless it's intentional (such as overriding #to_s or #== ).

shokai commented 7 years ago

I do not know why default method should not be overwritten. Most programmers do not know #send, and high-level programmers they want to use #send can read documents.

and, Why #__send__ exists? I think that send is assumed to be overwritten because it is a common name.

eagletmt commented 7 years ago

It turned out that my thoughts and yours are completely different. Closing this proposal.