3 ms·
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
by qznc 11y ago
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.