> Uh, what? Convention in Go and Rust sees errors be returned
Yes, but that's irrelevant. "Regular" return values don't have this coloring effect, but input have. It's a covariant / contravariant kind of thing. You should really re-read my previous comment if it went over your head.
> Perhaps like you need to propagate email addresses
No, again you get this backwards, you don't need to propagate the email address, errors suppose a specific kind of control flow that is different than non-error values. Again the correct analogy is the input type, not the return type. Understanding this is a prerequisite of understanding the whole concept so you should really take some time thinking about it.
> Oh, I wasn't surprised. It was clear from your first comment that your emotions aren't letting you think straight.
You're projecting your own mindset on me, I've been neither emotional nor aggressive in this entire thread, despite repeated attempt on your side to heat things up.
> Yes, but that's irrelevant. "Regular" return values don't have this coloring effect
It is certainly not irrelevant as that is the very topic of conversation. The topic of conversation was clearly and specifically defined by "In Go or Rust, returning an error is also a “color” that spreads out to the top of the call stack." But you're right to finally come around to realizing that there is no coloring effect created by that. Glad you were able to learn something today!
> errors suppose a specific kind of control flow that is different than non-error values
They might want a different kind of control flow in some circumstances, but it is not supposed. Email addresses might also want a different control flow in some circumstances (e.g. a "local" address).
> Again the correct analogy is the input type
It is quite possible to introduce an indirect dependence through inputs as much as it is possible through outputs, if that is what you are trying to say. I'm not sure your example successfully demonstrates that, though. There is nothing to suggest that email isn't relevant to `bar`, even if the actual "black box" implementation happens to call upon `foo`. I see no evidence of implementation details leaking, which can be demonstrated by removing `foo` and refactoring `bar` to:
function bar(name, email){
sendMail("Hello ${name}", email);
}
> You're projecting your own mindset on me
No, but I read what you wrote. Perhaps I have misinterpreted it? What did you mean by "tone" if not something that pertains to your emotions?
> despite repeated attempt on your side to heat things up.
Admittedly, in context, this too reads like you are referring to your emotions. But as you also seem to be trying to assert that they are not weighing on you, what are you actually trying to say here? You have not made yourself clear, I'm afraid.
> The topic of conversation was clearly and specifically defined by "In Go or Rust, returning an error is also a “color” that spreads out to the top of the call stack."
Returning an error has this property, yes. And errors Alps have this property when they are propagated separately from the return value (like unchecked exception in Java). Returned values do not have this property.
> . Glad you were able to learn something today!
I've tried with much patience and good faith in spite of your aggressiveness to explain this things in ways you can understand them so you could actually be learning something, but it looks like your ego is too fragile for that.
That's really unfortunate for you as it's the recipe for perpetual mediocrity. Good day.
Only in the same way that returning an email address does. That does not change the color, though. It remains "black". This is just "normal" use of a function.
Yes, you can go out of your way to leak implementation details making the function no longer "black". async/await, use of the "?" operator, "return err", even checked exceptions all introduce leakage. That can result in a colorful rainbow of functions, but "unless you are doing it wrong" was caveated at the very beginning. The very first sentence I wrote, in fact.
Is that the source of your confusion, perhaps? That you somehow forgot to read the very first sentence? async/await is the only one that isn't yet generally considered a bad practice, and only because it is quite a bit newer than all the others, as we always learn in the end that leaking implementation details leads to pain.
> I've tried with much patience and good faith in spite of your aggressiveness
I really don't understand what you are trying to say here. Aggressiveness? Patience? Good faith? These have no applicability to the conversation, so I am, again, not sure what you are trying to say. Further, these are words that are usually used around emotion, which we both seemingly agreed does not shape our reading of the discussion, so I have no idea what else they could be referring to. What do you mean?
Yes, but that's irrelevant. "Regular" return values don't have this coloring effect, but input have. It's a covariant / contravariant kind of thing. You should really re-read my previous comment if it went over your head.
> Perhaps like you need to propagate email addresses
No, again you get this backwards, you don't need to propagate the email address, errors suppose a specific kind of control flow that is different than non-error values. Again the correct analogy is the input type, not the return type. Understanding this is a prerequisite of understanding the whole concept so you should really take some time thinking about it.
> Oh, I wasn't surprised. It was clear from your first comment that your emotions aren't letting you think straight.
You're projecting your own mindset on me, I've been neither emotional nor aggressive in this entire thread, despite repeated attempt on your side to heat things up.