Comment by __s
3 days ago
In Ruby you tend to use :symbol for small immutable strings
<< is inplace append operator for strings/arrays, while + is used to make copy. So += will make new string & rebind variable
3 days ago
In Ruby you tend to use :symbol for small immutable strings
<< is inplace append operator for strings/arrays, while + is used to make copy. So += will make new string & rebind variable
I’ll just kill the comment. It said Symbol isn’t garbage collected. It has been since 2.2 and I wasn’t aware. Sorry.
Good reminder that anyone can go on the internet, just say stuff, and be wrong.
Symbols have been GCed since CRuby 2.2 https://bugs.ruby-lang.org/issues/9634
Well thats great, guess I have carried that baggage with me as misinformation for years now.
2 replies →
dynamically created symbols have been garbage collected for almost 10 years
Yeah I am a moron. Updated.
2 replies →