by option_greek · 5y ago · 0 comments
Would have been easier to implement with a copy constructor I guess. Why not implicitly clone in some cases (since classes like String gets used so frequently).
Automatically copying strings may not be a great idea: https://news.ycombinator.com/item?id=8704318
Because they get used so frequently. Why would we want to add expensive clones to frequently used operations?
This would be like asking why LINQ methods in C# aren't deferred by default. Yes, there's a few situations where that would be nice but it would make the functions largely useless because of how poor performance would be.