Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I don't understand this. Not everything is always a trade-off. Take array sorting, a classical example. There are many stupid solutions that have both unnecessary memory/time requirement and unnecessarily large code size and method complexity. Such code can be always traded for a more efficient solution "for free", at least before deployment.


You're right in a way, but I was surprised by how even the worst algorithms you learn in school have some properties that are better than the ones considered the best (e.g. bubble vs quicksort, quicksort isn't stable). This website makes it pretty clear: http://www.sorting-algorithms.com/

To the larger point: everything is a tradeoff once we refuse to consider the "stupid solutions." Yea, bogosort is absolutely stupid, but we don't really think about it when seriously designing software. Instead, we're left with the smart solutions, none of which can be considered optimal for all applications.

Everything is a tradeoff is a tautology. Because if one algorithm was proven to completely dominate another algorithm, we would no longer seriously consider the weak algorithm.


It's pretty easy to make quicksort stable. The more interesting comparison is with insertion sort, which is often used for small arrays.


But whether to ship what you have or spend time searching for a better solution is a tradeoff.


But that's not computer science.


My point exactly. That's a human resources and engineering level tradeoff. It's not a tradeoff on the level of pure computer science.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: