News for hackers. Stuff that matters.
Re:Go 1.8 Release Notes by pmarreck on Thursday February 16, 2017 @05:35PM (#13664232)
> Go not having exceptions is a definite plus for the language. Adding them would be a change for the worse, not an improvement.

I disagree (I'm from the Elixir/Erlang "code the narrow happy path and accept failure as quickly as possible" camp) and want to see your empirical data that discarding exceptions was a good design decision. Because to me it seems like you would spend a lot of time writing unnecessary boilerplate code to check for errors everywhere (if you bother checking at all... and if you don't, you are begging to get into an inconsistent runtime state which could lead to extremely hard-to-trace bugs)

It is my informed opinion that all unexpected states are bad and should be logged and killed/restarted from a known state ASAP. (Basically, the Erlang philosophy.)

Here is my data: Here are the most-used words in Go https://anvaka.github.io/common-words/#?lang=go ("if err != nil return err," anyone?) and here are the most-used words in Elixir https://anvaka.github.io/common-words/#?lang=ex . Sure seems like a lot of Go code is written to handle these "exceptions" they're not having! ;)

I didn't actually come here to debate Go, but statements like yours without any evidence to back them up are basically a religious belief and absolutely nothing more.

Re:Go 1.8 Release Notes by pmarreck on Thursday February 16, 2017 @06:02PM (#13664422)
Why am I getting downvoted for empirical data? That's at least an informed opinion with evidence. If 33% of your code is error-handling in 1 language, and in another language it's 2%, and both languages are equally performant and have similar logic, then how is that not bad? That's 31% more code to do the same work!
Re:Go 1.8 Release Notes by cdelsolar on Friday February 17, 2017 @01:17PM (#13670401)
"If you bother checking" - yes, you absolutely must check, and consider the repercussions of every error. This results in much better functioning, more stable, and easier to reason about code than blanket exceptions.
Re:Go 1.8 Release Notes by azinman2 on Thursday February 16, 2017 @05:54PM (#13664373)
You have errors, which functionally can be considered equivalent (yes small differences here and there but from a programming standpoint it's more like java forcing you to try/catch due to the multiple return values).
Re:Go 1.8 Release Notes by pmarreck on Thursday February 16, 2017 @06:38PM (#13664651)
Except that I'm forced to try/catch on every line that can possibly produce a runtime error.

If you were selling this language to me, how would you explain writing 33% more code to do the same business logic, just to handle errors, over something like Elixir with its rather astonishing uptime and response rate and almost no boilerplate error-handling code? For the backend of an API or webserver, hypothetically.

Re:Go 1.8 Release Notes by azinman2 on Thursday February 16, 2017 @07:19PM (#13664880)
So I don't know elixir, but but reading up on it the main different seems to be that you can silently ignore errors? You can do the same thing in Go, except it's demarkaed by assigning the error to _. Not sure what the main difference is otherwise?
Re:Go 1.8 Release Notes by pmarreck on Friday February 17, 2017 @07:32AM (#13667790)
Any errors crash the node (they are NOT silent, that's the whole point!) and get logged and then restarted by the supervisor node in well under 1 ms. In the event of too many restarts in too short a time, the supervisor is restarted by ITS supervisor (supervision hierarchy). In this way you only have to code the happy path and walk the "known states" while noting frequent sad paths/"unknown states". You can then elect to handle them in your code.
Re:Go 1.8 Release Notes by azinman2 on Friday February 17, 2017 @11:39AM (#13669549)
You can still have fatal paths that don't ever get solved, or some large % like that. Running the Go process under something like supervisord would give you the same effect.. it's not clear why this is so different, or why this needs to be at the language level.

In either case, you should be handling errors.

Re:Go 1.8 Release Notes by pmarreck on Friday February 17, 2017 @01:11PM (#13670358)
True, I guess.

Just found this comparison which is at least interesting: https://www.slant.co/versus/126/1540/~golang_vs_elixir

Re:Go 1.8 Release Notes by HeyImAlex on Thursday February 16, 2017 @08:32PM (#13665213)
Rust uses error values and its error handling is pretty terse (and more type-safe), so this is more of an indictment against go than error values in general.