Hacker News new | ask | show | jobs
by lpapez 1532 days ago
I felt the same way about Go until I've tried using it in a large corporate setting. The linters will absolutely scream at you if you ignore the returned error, and you will need to comment //nolint to silence it which immediately attracts the reviewers attention. The net result is that errors are basically impossible to ignore in Go as well.

If you're writing alone in a vacuum without linters, then I agree that Rust is more explicit.

1 comments

I have accidentally failed to handle errors in golang code in a large corporate setting that was run under multiple linters. This was "simple" and straightforward code, and the last time it happened was within the past month. I wish I remembered exactly what I did, but it was rebased over to be fixed.

If you need sufficiently advanced linters to catch every case, your error handling is not explicit. Especially if those linters are not currently sufficiently advanced.

> If you need sufficiently advanced linters to catch every case, your error handling is not explicit.

You're conflating "explicit" and "statically verified".

Agreed that static verification by default is ideal. Rust wins here.