The one the stack trace points at. You would literally see the name of the problematic function and the line number in the stack. There's no chance that you will accidentally "forget" to log an error properly. No discipline required by the developer.
Absolutely. However, when reading/browsing the source code, you don't know which methods throw which exceptions, where those exceptions are handled and what the control flow looks like. You immediately see what's happening when looking at Go (or Rust) source code - the control flow is very explicit and obvious. But this probably is a matter of personal preference.
Oh my, no this isn't an enjoyable debate.
Your claims are based on your subjective perception and, if I'm honest, quite disconnected from the reality.
Go promotes diversity and code sharing much better than a lot of languages. You can literally use any repo as a package. Therefore there isn't a monopoly over http like it is in case of Spring, but plenty of options, yet you are not obligated to use them.
Leave the comments, there was a lot of examples readers might find useful, which was ultimately the goal of the article.
I'm programming in rust nowadays and like Go, error handling is explicit.
Rust has syntactic sugar with the "?" keyword to forward errors and let the caller handle the error. Does Go have the same feature ?
Absolutely. However, when reading/browsing the source code, you don't know which methods throw which exceptions, where those exceptions are handled and what the control flow looks like. You immediately see what's happening when looking at Go (or Rust) source code - the control flow is very explicit and obvious. But this probably is a matter of personal preference.
Oh my, no this isn't an enjoyable debate.
Your claims are based on your subjective perception and, if I'm honest, quite disconnected from the reality.
Go promotes diversity and code sharing much better than a lot of languages. You can literally use any repo as a package. Therefore there isn't a monopoly over http like it is in case of Spring, but plenty of options, yet you are not obligated to use them.
Leave the comments, there was a lot of examples readers might find useful, which was ultimately the goal of the article.
I'm programming in rust nowadays and like Go, error handling is explicit.
Rust has syntactic sugar with the "?" keyword to forward errors and let the caller handle the error. Does Go have the same feature ?
Nope, Go doesn't have that.
Both Rust and Go use the return value as an indicator of an error and enforces handling it on spot, but that is the only similarity.
Go's
error
interface is defined by the presence of anError() string
method and cannot do anything, but becoming a string.Rust's
Result
has handy methods likeunwrap
orexpect
, along with the sugar.