When Would You Ever Want Bubblesort?
buttondown.com·4d·
Discuss: Hacker News
🦭Podman
Preview
Report Post

There are very few universal rules in software engineering, but there are are a lot of near-universal principles. Things like "prefer composition to inheritance" is near-universal. I love finding the rare situations where these principles don’t hold, like where you do want inheritance over composition. A similar near-universal principle is "don’t use bubblesort". Some would even say it’s a universal rule, with Donald Knuth writing "bubble sort seems to have nothing to recommend it, except a catchy name and the fact that it leads to some interesting theoretical problems".1 But Knuth’s [been wrong before](https://en.wikipedia.org/wik…

Similar Posts

Loading similar posts...