4 ms·
What I don't understand is why Go is not simply copying something from another community. And yes it will be incompatible with the "old way", but what is the "o
by erikb 9y ago
What I don't understand is why Go is not simply copying something from another community. And yes it will be incompatible with the "old way", but what is the "old way" with such a young language anyways. But then at least you don't need to learn the basics again that have been solved a hundred times already. Just copy&paste and then move on to other topics.
And while you are at it, also add real exception handling instead of asking people to reraise exceptions under each and every function call. And instead teach people to actually handle most of the exceptions from underlying libraries, maybe reraising a more context-appropriate one on the current abstraction level.
- crispinb 9y ago> What I don't understand is why Go is not simply copying something from another community The proposal explains this pretty clearly, using Cargo as an example, and listing what the Go team sees as its shortcomings (at least for golang). Is there an alternative extant approach that you think they've missed? > And while you are at it, also add real exception handling They're not going to do this. There are philosophical disagreements between advocates of different approaches here, and Go has very clearly picked its side. https://blog.golang.org/errors-are-values https://blog.golang.org/errors-are-values is a good exposition of the case. If it doesn't convince (or at least mollify) you, you probably should either suck it up, or avoid Go where you can.
- kasey_junk 9y agoIt would be way more persuasive if they didn't fall back to panic/recover semantics that are exceptions.
- ngrilly 9y agopanic/recover is a bit different from exceptions because it can be used as a control structure (like if/for/switch) inside a function. Rust has something similar with panic!.
- kasey_junk 9y agoI’m not sure how that is different than try/catch/finally?
- ngrilly 9y agoThe main difference is that you cannot catch a specific block of code in the function body. You can only catch when leaving the function (in a defer clause in Go). try/catch/finally is really a control structure. panic/recover is not. But I agree the difference is not clear cut and not easy to comprehend without coding a bit using both approaches.
- erikb 9y ago> The proposal explains this pretty clearly, using Cargo as an example, and listing what the Go team sees as its shortcomings (at least for golang). Is there an alternative extant approach that you think they've missed? That IS what I claim is wrong. There is no reason to argue about it. Yes, each existing solution has a problem. But so will their final solution. The differnce is that an existing solution doesn't need much time to invent, it's already invented. And you also already know what its shortcomings will be so you can handle them as well. The problem is having the arrogance to come up with something better given another 10 years. Unlikely and too huge an investment. > There are philosophical disagreements between advocates of different approaches here, and Go has very clearly picked its side. What is this discussion anyways? When I see go tools reraising errors from their underlying libraries, that is a clear, community wide bug. The user shouldn't care about what library you use, and certainly he shouldn't know your choice of library's ins and outs. Also it's very clear that if a 1 line function call has at least 3 more lines of code, that it is more spammy than Java. Yes, there are philosophical differences, but go didn't choose any of them but instead did something that is worse. In some regards it's the same as with package management. The choice was taken to solve a problem that was solved a thousand times already, and they had the hope that investing another 10 years of developer time they would come up with something better. Well, as statistics suggests they failed, badly. Would you invest 10 years of a whole community to invent a machine that keeps your milk cool? Probably not. You would probably buy a fridge and be done with it. > you probably should either suck it up Where does this arrogance come from? Are you 15 or something? A grown up person is confident when they achieved something, not when they failed at reinventing the wheel, which many people told them is a waste of time.
- crispinb 9y agoYou seem terribly emotional on this relatively trivial topic. I'll leave you to it.