2 ms·
so does panic() in Go. But no-one claims that Go uses exceptions for error handling, because it doesn't and neither does Rust. In both languages panic() is for
by kjksf 10y ago
so does panic() in Go. But no-one claims that Go uses exceptions for error handling, because it doesn't and neither does Rust.
In both languages panic() is for "this shouldn't happen" fatal errors, not for signaling errors to the caller, the way Java or C# use exceptions.
My comment was in response to person basically saying "checked exceptions in Java would be good if only they implemented it the way Swift/Rust did".