by nprateem · 5y ago · 0 comments
Explicit error handling can be tedious, but I’m never confused about what some code will do.
Compared to Java where an exception may bubble up 10 layers to a catchall try catch statement, I actually know where the error is coming from.
Would be nice to have this abstracted away with tooling though. I would imagine go generate could be used to great effect in this arena.
I prefer returning errors as a part of the function result myself, as you would in any decent language encouraging functional programming principles.
If anything, it shows that including a feature in a language (exceptions) will not lead to people misusing it if that misuse is not encouraged.