Skip to content

Comment on Ruby mistakesparent

Comments

> Hashable mutable objects are a giant liability. Ruby even has freezing of objects, so it should only allow hashing frozen objects at least.

Well, of all dangerous things you can do with ruby, this is one of the least dangerous ones. How about "any gem can monkey patch any other gem or even core classes"? Isn't this a giant liability?

Besides, it's not that difficult to make your custom hash that only allows immutable objects for keys.

Indeed it is, but at least that liability is much more obvious and publicised.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.