|
|
|
|
|
by pluma
3524 days ago
|
|
To address your first point: There is an amazing amount of software where even O(n!) vs O(log n) doesn't matter. There is also of course a lot of software where it does. There is even more software where it does matter in some parts of the code but doesn't in others. Every optimization has a cost. Time is a finite resource. Time spent optimizing one thing could be spent optimizing something else or implementing a new feature or fixing a bug. That said, the original argument isn't that that which Big-O notation represents is generally irrelevant. The argument is that the formalism of Big-O notation itself is generally irrelevant (except where it isn't, obviously). You don't need CS101 to understand that a nested for-loop probably scales worse than a single if-statement. Or that looping over the input twice in succession is probably faster than nesting those loops. Or that only looking at half the input is faster than looking at all the inputs, and so on. To put it in other words: you can figure out that something that scales from an ant to an elephant to a skyscraper scales worse than something that scales in multiples of ducks without having to use a ruler or charts. Big-O is the more accurate tool but there is a tremendous amount of situations where you don't need an accurate tool and a vague understanding of the same thing the tool would measure is entirely sufficient. |
|
That sentence kinda defeats the argument itself. If it's irrelevant except where it is not, then your argument is obviously true.
We could also say that some number X is always not 1 except when it is.
>You don't need CS101 to understand that a nested for-loop probably scales worse than a single if-statement.
That is true, but it's just Big-O applied via intuition rather than learning.
Big-O is mostly the expression of intuition for some people.