3 ms·
So sorting is a leaky abstraction? Because merge sort and bubble sort can both have the same interface, isolating you from underlying details...
by parsnips 8y ago
So sorting is a leaky abstraction? Because merge sort and bubble sort can both have the same interface, isolating you from underlying details...
- elvinyung 8y agoYes, exactly. The slowness of the bubble sort "leaks" the fact that it's a bad/naive implementation of sorting.
- tabtab 8y agoAbstraction is often defined similar to "hiding irrelevant details" so that one can focus on the forest instead of the trees. However, sometimes tree-level issues affect the forest view also. An unexpectedly slow sort operation may be such a case. Normally you cay "ORDER BY x" in SQL and not worry about HOW the RDBMS sorts on "x": "How" is a "grunt-level detail" to you. But if the sort is slow or "wrong" (such as a collating sequence not expected by the customer), THEN you have to dig into the details, stepping out of the abstraction forest to visit and study individual trees.