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.

Error Handling in C++: Why You Should Use Eithers, Not Exceptions or Error-Codes

9 pointsby adgasfabout 8 years ago

2 comments

shaknaabout 8 years ago
This has come up before [0], quite recently, though not this particular article.<p>Some of the points that stood out to me, in opposition of the article&#x27;s &quot;this way is better&quot;:<p>* Exceptions are usually free if not thrown... If they are thrown... You&#x27;re in an error path. You don&#x27;t usually care about speed.<p>There&#x27;s a long list of problems here [1].<p>[0] <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=14316539" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=14316539</a><p>[1] <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=14321083" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=14321083</a>
uwuabout 8 years ago
shouldn&#x27;t an optimization like this be performed by compilers?