4 ms·
It's good to know algorithms, but in (for example) sorts, it is a much worse error to write your own sort (based on the best algorithm), than to check if your p
by rossdavidh 8y ago
It's good to know algorithms, but in (for example) sorts, it is a much worse error to write your own sort (based on the best algorithm), than to check if your problem has already been well solved by an existing library you can import without great cost. Not everything needs to be an import, but really in over a decade of development for multiple different organizations solving different problems, I've never seen a case where writing your own sort was a good idea. The same is true of many other algorithm categories. Not to say it's not good to know about, but that's how you can be a quite productive programmer without knowing algorithms like bubblesort off the top of your head.
If, for example, you need to hash/salt passwords correctly and you haven't done that lately, even if you remember for certain how to do it, you should look it up to see if the best method has changed in the last year. Knowing algorithms off the top of your head might almost be a negative, if it makes you less likely to check with a bit of research first when it's time to use one.