TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Big-O Was a Lie

1 pointsby karagenitover 3 years ago

4 comments

warrenmover 3 years ago
Author of OP needs to read <a href="https:&#x2F;&#x2F;math.stackexchange.com&#x2F;q&#x2F;4252237&#x2F;3124" rel="nofollow">https:&#x2F;&#x2F;math.stackexchange.com&#x2F;q&#x2F;4252237&#x2F;3124</a>
quantifiedover 3 years ago
The issue wasn’t algorithm complexity but algorithm behavior. Author definitely has learned something about promoting articles, has not apparently learned or thought about software performance.<p>The constant factors also play a huge role, as the author found out. Do you want a car that takes 2 hours to warm up and then accelerates to 200mph in 5 seconds, or a car that goes 0-60 in 10 seconds and tops out there? Depends on how far you’re going.<p>I’m not sure I’d want to hire them after reading this, but a piece about how big O isn’t the full picture would get sympathy.
jfengelover 3 years ago
Big-O isn&#x27;t a lie. The utility of Big-O is a lie.<p>Students are told that cyclomatic complexity of algorithms is the be-all and end-all of performance. They&#x27;re trying to replace the student&#x27;s intuitive idea that opcode-level optimization is the be-all and end-all of performance.<p>In practice, performance rarely depends on either of those. And performance as a measure of merit -- either the program&#x27;s or the programmer&#x27;s -- is also rarely the most important thing.<p>Big-O is taught because it&#x27;s a thing you can teach. Students need to practice writing programs, and fundamental algorithms have the advantage that they don&#x27;t require either domain expertise or knowledge of any particular framework. They get to practice writing code using just the language they&#x27;ve learned, with a simplistic goal like putting data in order.<p>That&#x27;s also the reason it shows up in so many interviews. It&#x27;s easy to test and objective. And it feels important, even though it&#x27;s almost never a tool you&#x27;ll use in real life as a programmer.
warrenmover 3 years ago
Great clickbait title :)<p>Big-O is a way to class algorithms&#x2F;methods into similar categories<p>It is distinctly <i>NOT</i> a profiling tool!<p>O(n) is [almost] always better than O(n2)<p>Likewise, O(logN) is [almost] always better than O(n)<p>But just because you&#x27;re comparing within rough categories doesn&#x27;t mean they&#x27;re the <i>same</i><p>Crab apples are apples<p>Just like Northern Spies<p>But other than being &quot;apples&quot; ... they&#x27;re nothing alike - one is about an inch in diameter, the other 3-4&quot;. One&#x27;s crisp, solid, and mildly sweet-tart...the other is practically uneatable without tons of sugar<p>But they&#x27;re not bananas<p>And that&#x27;s what Big-O is all about - putting the <i>classes</i> or <i>types</i> of algorithms into groups<p>Sounds like the author had no clue what he was being told in college (which is concerning ... it&#x27;s something I had explained by every compsci and infosys instructor and professor I had over the course of dozens of classes)