4 ms·
On top of that, you never know the context in which your users will call your library. Are you encoding a single file on a local machine? Or 1000 files on some
by randyrand 5y ago
On top of that, you never know the context in which your users will call your library.
Are you encoding a single file on a local machine? Or 1000 files on some HPC 128-core machine?
Do we really want to be in a world where all libraries need to be written with and without exceptions since we can't know the context they'll be used in?
- wvenable 5y agoWhy is the error occurring in the first place? In my opinion, exceptions/errors should be rare. If it's a software problem, it should eventually be fixed. If it's an infrastructure problem, it should be fixed. It's not just something that should continue to happen without any mitigation what so ever over time.
- kllrnohj 5y agoNot all errors have "fixes". If I navigate to "https://news.ycombinator.com/nope https://news.ycombinator.com/nope" it returns an error to me. Is that a software problem or an infrastructure problem? And what's the fix? How do you "fix" a bad input to the system from an external actor? So no, errors/exceptions are not rare depending on the context. So now do you use exceptions and accept that it doesn't scale across core counts? Or do you use return values and accept that it just makes all your code slower in all cases? 1% error rate sounds like a lot. But really how many HTTP errors do web servers return on average? Or other such systems? It's definitely more than 0%, and those services also scale nicely across multiple cores, so... Now we're just bikeshedding over the example numbers, not the core issue.