Comment

Comment by erustemi

I tend to agree with you, not for the different semantic aspect, since they both are capable of expressing the same thing (with checked exceptions), but for the performance impact of exceptions. If I'm not mistaken throwing an exception has a much larger cost than a simple return due to needing to construct the stacktrace.

So using exceptions for an expected path of a function seems sub-optimal.

parent erustemi 2 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton