3 ms·
if this was true, why would we have so many sorting algorithms in the first place? It's not enough to express the desired result. We would also need to express
by marcus_holmes 10y ago
if this was true, why would we have so many sorting algorithms in the first place?
It's not enough to express the desired result. We would also need to express our preferences for all the other decisions and trade-offs that are made during software development. Do we need this sort to be fast or use as little memory as possible? Synchronous? Does it need an index? Are we optimising for writes or reads? Persistence? What language are we sorting by?
That's for a simple sort. By the time you get into actual problems then it all gets more complex and the trade-offs become something you need to understand before making a decision on. Having an expert to make those decisions is good.
- mLuby 10y agoOne advantage could be ease of refactoring. Imagine starting with "goal: the list is sorted", but the resulting program is uses too much space to achieve it. It could be a lot easier to add "goal: the list is sorted in O(n) space" than it is to rewrite your sorting algorithm.