Forum: Ruby-core [ruby-trunk - Feature #7384][Open] Rename #each_with_object to #each_with

Posted by Thomas Sawyer (7rans)
on 2012-11-18 12:13
(Received via mailing list)
Issue #7384 has been reported by trans (Thomas Sawyer).

----------------------------------------
Feature #7384: Rename #each_with_object to #each_with
https://bugs.ruby-lang.org/issues/7384

Author: trans (Thomas Sawyer)
Status: Open
Priority: Normal
Assignee:
Category: core
Target version: next minor


I propose that #each_with_object be renamed to #each_with, for the 
following reasons:

1. The original name is too long. When general purpose methods have long 
names it tends to deter developers from using them even when they are a 
good fit to the use case.

2. The last word, "object", is completely redundant. All methods that 
take an argument could say the same thing. e.g. Array#push is not named 
#push_object though that is obviously what it means.

3. The change need not effect backward compatibility b/c 
#each_with_object can remain an alias of #each_with for as long as 
deemed necessary.
Posted by Eregon (Benoit Daloze) (Guest)
on 2012-11-18 13:11
(Received via mailing list)
Issue #7384 has been updated by Eregon (Benoit Daloze).


I couldn't agree more!

Enumerator#with_object should become Enumerator#with as well.

----------------------------------------
Feature #7384: Rename #each_with_object to #each_with
https://bugs.ruby-lang.org/issues/7384#change-33054

Author: trans (Thomas Sawyer)
Status: Open
Priority: Normal
Assignee:
Category: core
Target version: next minor


I propose that #each_with_object be renamed to #each_with, for the 
following reasons:

1. The original name is too long. When general purpose methods have long 
names it tends to deter developers from using them even when they are a 
good fit to the use case.

2. The last word, "object", is completely redundant. All methods that 
take an argument could say the same thing. e.g. Array#push is not named 
#push_object though that is obviously what it means.

3. The change need not effect backward compatibility b/c 
#each_with_object can remain an alias of #each_with for as long as 
deemed necessary.
Posted by boris_stitnicky (Boris Stitnicky) (Guest)
on 2012-11-19 22:49
(Received via mailing list)
Issue #7384 has been updated by boris_stitnicky (Boris Stitnicky).


+1 for Eregon. #each_with_object is my favorite method, I love and 
always alias it to #ewo :)
----------------------------------------
Feature #7384: Rename #each_with_object to #each_with
https://bugs.ruby-lang.org/issues/7384#change-33129

Author: trans (Thomas Sawyer)
Status: Open
Priority: Normal
Assignee:
Category: core
Target version: next minor


I propose that #each_with_object be renamed to #each_with, for the 
following reasons:

1. The original name is too long. When general purpose methods have long 
names it tends to deter developers from using them even when they are a 
good fit to the use case.

2. The last word, "object", is completely redundant. All methods that 
take an argument could say the same thing. e.g. Array#push is not named 
#push_object though that is obviously what it means.

3. The change need not effect backward compatibility b/c 
#each_with_object can remain an alias of #each_with for as long as 
deemed necessary.
Please log in before posting. Registration is free and takes only a minute.
Existing account (Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
No account? Register here.