3 ms·
You should optimize when it’s net useful, not just because you know how. Making a random function faster and harder to maintain is bad engineering if the speed
by philosopher1234 4y ago
You should optimize when it’s net useful, not just because you know how. Making a random function faster and harder to maintain is bad engineering if the speed isn’t useful.
- adwn 4y ago> Making a random function faster and harder to maintain is bad engineering if the speed isn’t useful. 1) It's not some random function, it's part of the standard library. 2) Three-way string compares are far from uncommon, and string comparisons are relatively expensive. Therefore, a speedup would be useful. Optimizing this function would not count as "premature".
- codeflo 4y agoAgain: How is adding a new, “bad” implementation any easier to maintain than simply calling the already existing optimized one that the GP linked to?