8,634 karma · joined Jun 23, 2011 (15y ago) · 7,679 submissions
comment 3y ago · link · parent
No. I can't think of anything I buy that I would want to go back in time with. The quality in my experience has only improved, often dramatically. Those who try to skimp on quality get destroyed by the competition. What are you referring to?
The only thing I can think of that you might be referring to – based on what I hear other say, not based on my own buying habits – is things like appliances where manufacturers have really dug deep into computerization so that they can enjoy the same legal moats other tech companies do. But what you are experiencing there is the lack of competition we spoke of earlier.
comment 3y ago · link · parent
Industries where direct competition is allowable do not suffer from these problems.
comment 3y ago · link · parent
That's incorrect. Apple here refers to a group of people, not the fruit. Google here too refers to a group of people, not the software that provides search features.
> They do NOT HAVE FEELINGS you need to defend.
Their feelings need to be defended as much as any other person. Which, logically, is not at all, but as you are defending your own feelings here what is logical is already violated, so...
comment 3y ago · link · parent
Logically, getUserByID returns nil when there is no user, not a fake user. The caller can then check for its nil-ness without needing to consider the error value. nil is a useful value. For better or worse, nil is how Go convention represents the absence of a value. In fact, convention sees error also rely on nil to be useful in the very same way.
It's funny how people completely forget how to write software as soon as they see the word error. Why is that?
comment 3y ago · link · parent
Markets are regulated to enable monopolies. Bell would have never become a monopoly if there wasn't the regulation involved in laying copper and Microsoft would have never become a monopoly if there wasn't intellectual property regulation.
comment 3y ago · link · parent
That doesn't mean that humans want to eat those grains, even if they were to consume the same kinds of grains.
You've probably noticed that human-grade grains are considerably more expensive. It is in the interest of the farmer to produce those higher quality grains for the sake of profitability, but sometimes the Mother Nature just doesn't play nice.
Sometimes all you can produce is animal-grade food. Being able to also capture those calories helps feed the large and growing human population.
comment 3y ago · link · parent
Is that the claim actually that they are general purpose, or do people not understand the claims made? Go has been very explicit that it is designed for systems programming. The Rust camp seems to hold a similar position. "Systems" implies that it is not designed for all tasks. But I'm not sure "systems" is properly understood by a lot of people.
comment 3y ago · link · parent
That's what the original commenter said. Logically, how else could you forget to handle the error? The compiler will bitch and moan if you do capture the result and then don't do anything with it. You did take the time to read the thread before replying, yes?
> This is not at all a relevant issue
It must be, else how do you explain the many comments you wrote trying to explain how sum types solves the problem? Even while I continually told you they don't.
> Why are you discussing whether Go's error handling needs improvement if your imagined programmer can't even program?
I said that it doesn't need improvement because in practice your tests will catch the problem immediately anyway. I even said that it is probably fundamentally impossible for there to be technical solution to the problem.
And the rest of the time was telling you that sum types cannot solve the problem, despite your constant urging. I am still not clear how you think sum types solve the problem.
> Well, I've spent enough time on this thread.
Are you sure you spent any time on this thread?
comment 3y ago · link · parent
func foo() error
With the programmer forgetting to handle the error: foo()
Now imagine that Go received some kind of hypothetical Result type. The foo function is updated to use it: func foo() Result[error]
But the problem remains. The compiler still isn't going to tell you that you forgot to handle the error.comment 3y ago · link · parent
Except the non-error value should always be available, even if that means relying on the zero value. Zero values should be useful. An error state is an independent state. It should also be useful without any other values.
While the caller may choose to use the error state to make decisions about other state, it is faulty API design to force that upon the caller.
comment 3y ago · link · parent
Like we established in my very first comment, well before you even showed up, the handling forgetfulness problem exists for all types. That would include a hypothetical (tagged) union type. I did question if you were using some other definition of sum types, as there isn't a great consensus on what sum types actually mean, but you did confirm you were thinking of tagged unions...
But it must be that you didn't actually mean tagged unions. What is the definition of sum types that you are using here that would help with the stated problem?
comment 3y ago · link · parent
This is not a general "wouldn't it be nice of Go had..." thread. We are talking about a specific problem.
comment 3y ago · link · parent
Even an advanced type system capable of formal proofs isn't going to help you if you've forgotten the requirement when defining the types. And if you are using a language with a lesser type system (Go, Rust, any language you are likely to use in the real word), and haven't forgotten the requirement, then you would have encoded that knowledge in tests instead, making the forgetfulness in implementation ultimately immaterial. After all, there is no practical difference between learning that you forgot to implement logic by the compiler telling you or the test suite telling you.
So, we can infer that the OP is talking about where one straight up forgot about the requirement from start to finish. I'm skeptical that there is any technical solution to that problem, but sum types most certainly isn't it.
comment 3y ago · link · parent
It doesn't matter how many type layers you add. The problem is that there is nothing in the language that enforces handling of values, no matter what type that value might be.
comment 3y ago · link · parent
Assuming you share in that definition, while Go might benefit from tagged unions in general, I'm not sure they actually help in any way with remember to handle errors. A union is just as easy to forget to handle as a single discriminate type.
But perhaps you are of another sum type school? Perhaps one of the other sum type definitions are useful here?
comment 3y ago · link · parent
So, yes, it makes sense to have constructs that can help with that problem, but it would be weird to have such constructs only for what a human considers an error condition. You would want that for every case that needs to be handled.
Otherwise you have to resort to testing, and if you accept that testing is good enough to ensure that you don't forget to check the temperature, then it also good enough to ensure that you have checked an error. There is nothing special about the error case. It's just another state like any other.
comment 3y ago · link · parent
I never understood this. I do understand it is easy to forget to handle an error like it is easy to forget to handle a distance or temperature. Humans will make mistakes.
But nobody laments about how they forget to handle distances or temperatures, or cry for special constructs to ensure that they don't screw up their distance and temperature handling. What is it about the word error that sends developers into a tizzy?
Why would we want a solution that only works for errors and not for values of all kinds?
comment 3y ago · link · parent
There is no such thing as a best possible world. Not two people would ever be able to agree what that even is. Every benefit comes with a detriment. It's just a matter of what tradeoffs do you want to accept. Society has made its choice, seeing a regulated market as being more important than access to drugs for all (for now; that choice is fluid and able to change in the future should society change its views, but trying to predict the future is well beyond this discussion).
comment 3y ago · link · parent
After all, society can repeal the regulation if it wanted to – it created the regulations! But clearly it doesn't want to, because society recognizes it as a benefit and is willing to pay, perhaps as much as 10x more according to previous comments, to see that value delivered. That may not suit your or my fancy, but, again, society cannot cater to everyone.
Naturally, even society itself is both beneficial and detrimental, just like everything else. Tradeoffs, as always.
comment 3y ago · link · parent
College, for all its trumpeting about better outcomes, has shown no actual change in the financial success of the population. Incomes have held stagnant the entire time.
Thiel's experiment really just goes to reiterate what we already knew: That successful people are born that way.