3 ms·
Fully 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
by taeric 9y ago
Fully 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