by thowdfasdf23411 · 2y ago · 0 comments
> Not my experience.
To what experience do you speak of? My 5,000+ hours in kubernetes and terraform space tells me Rob Pike's views are fan fiction at best.
What new code being written today is violating that pattern?
Yet you admit to following the advice for error, returning the zero value for err and making it useful when you do. If you don't have a meaningful error state, why not just return junk? Clearly you recognize the value of making the return values useful, always. Why make exceptions?
Making the return value of e.g. a database handle always "useful" is a ridiculously dangerous idea that can lead to application bugs further down the route becaause some list/get returned an empty value to continue the pattern of "useful" empty values.
The main reason there is ever a useful error next to a non-nill err is because go doesn't have a useful way to not do it.
You are putting the burden of proof on me now? How unfair, You didn't bring any. Go to CNCF and pick anything written in Go.
> Let's be real, Kubernetes is a Java project
Let's be real, Rob Pike is the flat earther of PLT. Sum types are Rob Pike's Foucault pendulum.
No. I don't give a shit about what you do. Where did you dream up this idea?
> Let's be real, Rob Pike is the flat earther of PLT.
No doubt, but when using the programming language of flat earthers, one has to accept that the particular world is, indeed, flat.
But the advice is undeniably sound. There is no programming language where you should leave someone hanging with junk values. You might avoid junk in other languages using some other means (e.g. sum types), but it is to be avoided all the same.