3 ms·
Big-O isn't a lie. The utility of Big-O is a lie. Students are told that cyclomatic complexity of algorithms is the be-all and end-all of performance. They're
by jfengel 5y ago
Big-O isn't a lie. The utility of Big-O is a lie.
Students are told that cyclomatic complexity of algorithms is the be-all and end-all of performance. They're trying to replace the student's intuitive idea that opcode-level optimization is the be-all and end-all of performance.
In practice, performance rarely depends on either of those. And performance as a measure of merit -- either the program's or the programmer's -- is also rarely the most important thing.
Big-O is taught because it's a thing you can teach. Students need to practice writing programs, and fundamental algorithms have the advantage that they don't require either domain expertise or knowledge of any particular framework. They get to practice writing code using just the language they've learned, with a simplistic goal like putting data in order.
That's also the reason it shows up in so many interviews. It's easy to test and objective. And it feels important, even though it's almost never a tool you'll use in real life as a programmer.