News for hackers. Stuff that matters.
Re:Errors and Exceptions by qznc on Friday August 21, 2015 @08:38AM (#10097058)
Exceptions have another advantage not mentioned in the article: performance.

If you implement them as "zero cost exceptions", then there is no overhead for the successful path. Option 3 requires error checking even if you return successful, which can only be optimized away maybe if the compiler inlines and moves code around. Since Go and Rust favor static linking this might work. If you want to link libraries it does not.

There are no comments on this comment yet.