> for a web-focused scripting language it makes sense to default to mutable strings
Why do you say that? I would say the opposite.
Why do you say that? I would say the opposite.
Ruby isn’t making all strings immutable here. Just string literals. You are free to allocate mutable strings that can be appended to, to your heart’s content. It is extremely rare that modifying a literal is intended behavior, since their contents are permanently persisted throughout the lifetime of your program. With your example, this would be like having one shared global buffer for your final document.