3 ms·
Why would you optimize for the error case and not the common case? You've already done an unbounded amount of work copying the string in from the network or whe
by tedunangst 3y ago
Why would you optimize for the error case and not the common case? You've already done an unbounded amount of work copying the string in from the network or wherever. If anybody cared that much, they wouldn't let the string get that long in the first place.
- saagarjha 3y agoIt can be appropriate to bound the runtime of certain components of a system while allowing looser constraints elsewhere. For example I would perhaps not want to do an O(n) string operation on a collection of strings even though the user would be pretty upset if they can’t paste infinite input into my app.