Yet one more rant completely missing the point and whining about the lack of exceptions (which at least as implemented on most languages most sensible and experienced people agree foment bad error handling practices, so the current Go approach is superior) and generics (still unclear if they make any sense given Go's interface system, which the author completely ignores.)
And reading the rest of the gripes, the author clearly had zero interest in learning the language.
> (Yes, that is a statement you see between "if" and the test. No, it serves no real purpose beyond obfuscation.)
Way to show you have not learned anything about the language or even tried to write even a program a dozen lines long!
In particular you'll find an answer to your silly claim that exceptions are something that most sensible and experienced people agree foment bad error handling practices AND you'll find an explanation of why they are reasonable to omit from Go.
Fundamentally disagree with you on exceptions. Exceptions as implemented in e.g. Delphi or .NET work very well. In C++ the complexity of exception handling is deeply exacerbated by things like copy constructors - the bias in the language towards (what I call) value-oriented programming, rather than object orientation - and in Java exceptions are hobbled by the misguided notion that exceptions should be handled nearer the point of the throw rather than far away, in the relevant main loop of the app; hence the requirement to trace through annotations throughout the call graph from low-level throwing code to high-level catching loops, or basically avoid the bad design with RuntimeException.
I agree with the person you are disagreeing with, in this case. Go is being touted as a systems programming language.
My experience of very low level programming is that you want to know exactly what's happening, and especially when things go wrong. And you want to know what's gone wrong right at the point of it going wrong.
Exceptions are the wrong technique for this form of programming. When doing systems work you are spending a lot of time dealing with error situations and hence the handle the error and pass up an error code form is appropriate.
"Systems programming language" is a loaded term, IMO. Many people have used C - probably the canonical systems programming language - inappropriately for applications where better languages would have been more suited. We've paid the price in insecurity, buffer overflows, memory errors, etc. many times over. I think you need to more clearly define what you mean by it.
You can't mean very low level programming, since that is a very small fraction of all programming - and probably not the best domain of a general purpose programming language.
As I mentioned in another comment in this thread, I see exceptions as exactly equivalent to a rigorous approach to error codes.
I also note with interest that you describe the form as "handle the error and pass up an error code". This reads to me as a contradiction in terms. While the error code is still propagating, the error has not been handled. Some intermediate cleanup has perhaps been done, but normal code execution has not yet resumed. Moreover, exceptions have mechanically checkable formalisms for these phases of error handling.
Even in Kernel programming, exceptions are useful. If you read http://www.kernel.org/pub/linux/docs/lkml/#s15-5, you'll see that goto's are used to reduce code duplication for error handling, which is essentially just a poor man's exception. More sophisticated exception handling in C can and has been done with longjmp as well.
Guarantees in the case of error is an orthogonal issue. The same problem exists for error codes. In fact, I see exceptions as a formalization of an extremely rigorous approach to error codes, where in the case of a failure the error codes is immediately propagated to the callers after local cleanup.
Yet one more rant completely missing the point and whining about the lack of exceptions (which at least as implemented on most languages most sensible and experienced people agree foment bad error handling practices, so the current Go approach is superior) and generics (still unclear if they make any sense given Go's interface system, which the author completely ignores.)
And reading the rest of the gripes, the author clearly had zero interest in learning the language.
> (Yes, that is a statement you see between "if" and the test. No, it serves no real purpose beyond obfuscation.)
Way to show you have not learned anything about the language or even tried to write even a program a dozen lines long!