3 ms·
I wish Ruby would focus in immutability before this. As things stand, the language is built in a way that you've no guarantee that any object you hold as varia
by ddebernardy 12y ago
I wish Ruby would focus in immutability before this.
As things stand, the language is built in a way that you've no guarantee that any object you hold as variable won't change without you knowing. The net result is you either ignoring the problem entirely (until you runinto a bizarre bug introduced by a new library) or (more rarely) you re-inventing the wheel by being extremely verbose in all accessors where it matter.
- nitrogen 12y agoRuby has the .freeze and .clone methods on many types, but in general Ruby expects developers not to monkey with other objects without knowing the consequences.