TIL that Ruby has mutable strings, and (until the announced change) even had them mutable by default (and the change only affects literal strings; non-literal strings are still mutable). Python has always only ever had immutable strings.
We have mutable default arguments in Python ( https://docs.python-guide.org/writing/gotchas/#mutable-defau... ), by default too, though.
Ruby 3.4 frozen string literals: What Rails developers need to know
11–20 of 131 posts
Re: Ruby 3.4 frozen string literals: What Rails developers need to know
#12We learned nothing from Python 2->3 An obviously good change, actually massive performance improvements not hard to implement but its still gonna be such a headache and dependency hell
Re: Ruby 3.4 frozen string literals: What Rails developers need to know
#13TIL that Ruby has mutable strings, and (until the announced change) even had them mutable by default (and the change only affects literal strings; non-literal strings are still mutable). Python has always only ever had immutable strings.
Re: Ruby 3.4 frozen string literals: What Rails developers need to know
#14TIL that Ruby has mutable strings, and (until the announced change) even had them mutable by default (and the change only affects literal strings; non-literal strings are still mutable). Python has always only ever had immutable strings.
Re: Ruby 3.4 frozen string literals: What Rails developers need to know
#15Re: Ruby 3.4 frozen string literals: What Rails developers need to know
#16We learned nothing from Python 2->3 An obviously good change, actually massive performance improvements not hard to implement but its still gonna be such a headache and dependency hell
??? This is nothing like the Python transition. In Python there were two incompatible language versions side by side for years that made it really hard on library maintainers. Ruby is giving a 7-8 year transition period before this even hits, with years of warnings built-in to the plan. What more would you have them do?
Re: Ruby 3.4 frozen string literals: What Rails developers need to know
#17TIL that Ruby has mutable strings, and (until the announced change) even had them mutable by default (and the change only affects literal strings; non-literal strings are still mutable). Python has always only ever had immutable strings.
Strings are going to keep being mutable by default. Only strings created by string literals won't be.
Re: Ruby 3.4 frozen string literals: What Rails developers need to know
#18We learned nothing from Python 2->3 An obviously good change, actually massive performance improvements not hard to implement but its still gonna be such a headache and dependency hell
https://www.ruby-lang.org/en/news/2015/12/25/ruby-2-3-0-rele...
Most linting setups I've seen since then have required this line. I don’t expect many libraries to run afoul of this, and this warning setting will make finding them easy and safe. This will be nothing like the headache Python users faced transitioning to 3.
Re: Ruby 3.4 frozen string literals: What Rails developers need to know
#19TIL that Ruby has mutable strings, and (until the announced change) even had them mutable by default (and the change only affects literal strings; non-literal strings are still mutable). Python has always only ever had immutable strings.
just dont ask about unicode
Re: Ruby 3.4 frozen string literals: What Rails developers need to know
#20Is it the future path of any successful JIT / dynamic typed / scripting language to realize they needed all optimizations from compiled / statically typed / lower level languages ? Would Ruby be as successful if they had all those complicated features right from the start ? Or do all languages start from a nice simple clean slate tabula rasa to get developers hooked, until the language is enough famous to get well de…
I would actually say it’s the opposite in this case: it’s extremely common in scripting languages for strings to be immutable, mutable strings are usually only available in lower level languages. I’m very surprised Ruby had this feature at all.