15 ms·
The later you do it, the more expensive it gets. In this it is similar to testing.
by AstralStorm 9y ago
The later you do it, the more expensive it gets. In this it is similar to testing.
- taeric 9y agoFully agreed, though optimization is something that should come later. Otherwise, folks will spend too much time making a really tight loop that isn't actually run in a loop. :) I also agree that folks should try to avoid poor habits. However, I'll note that even Knuth uses brute force for some parts of his programs. Quoting, "Brute force is the rule in this part of the program."[1] Sometimes, it really isn't the bottleneck. :) [1] http://www-cs-faculty.stanford.edu/~knuth/programs/dance.w http://www-cs-faculty.stanford.edu/~knuth/programs/dance.w