On 12/12/2018 4:53 PM, headius / headius.com wrote:
> I propose that both methods should immediately be deprecated for removal in Ruby 3.0.

Agree on id2ref; *strongly* disagree on object_id.


> * They do not do what people expect.

object_id does precisely what I expect.


> * They cannot reliably do what they claim to do.

If so, let's fix the documentation of object_id.


> * They eventually lead to difficult-to-diagnose bugs in every possible use case.

How?

Sources of the embedded ruby portion of a robust C++ desktop application continuously
developed for 15+ years:

$ git grep object_id | wc -l
111


> Put simply, both methods have always been broken in MRI and making them unbroken would render them useless.

object_id has never been broken.  No need to tar it with id2ref's failings.


> I should point out that even the monotonically-increasing ID will eventually break once enough objects have been created to roll over a 64-bit integer limit

 ((2**64)/1_000_000_000)/60.0/60.0/24.0/365.25
  => 584.5420460681421

(Merely an aside, since I maintain object_id is fine as-is.  But this
appears to be a billion objects per second for 584 years.)


tl;dr: id2ref can go; please leave object_id alone.


Regards,

Bill



Unsubscribe: <mailto:ruby-core-request / ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>