Hacker News new | past | comments | ask | show | jobs | submit login

And the stack trace comes with its own issue; they are expensive. Which is fine, if the exception is actually true to the name - an exceptional situation.

But in practice / production, exceptions / errors are not exceptional. Take a HTTP server. Due to a myriad of reasons, the connection between the server and a client can be severed, triggering an error because the connection was broken. Is that exceptional? No, the internet is unstable and clients are unreliable. Is it therefore valuable to generate a stack trace every time that happens?

One exception is fine, but if you go web scale like Google, the "this connection was interrupted" case happens millions of times a day. Millions of times the cost of generating an exception + stack trace becomes really expensive. An error is cheap in comparison.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: