Comment by stouset
3 days ago
If you are using string concatenation to build HTML in your application layer, you are fundamentally doing it wrong.
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.
No comments yet
Contribute on Hacker News ↗